linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] nfs4-acl-tools: Fix segfault if format of the input file is incorrect
@ 2011-07-21 20:35 Malahal Naineni
  2011-07-21 20:35 ` [PATCH 2/2] nfs4-acl-tools: Don't call free_fields when memory isn't allocated Malahal Naineni
  2011-07-26  6:54 ` [PATCH 1/2] nfs4-acl-tools: Fix segfault if format of the input file is incorrect Venkateswararao Jujjuri
  0 siblings, 2 replies; 6+ messages in thread
From: Malahal Naineni @ 2011-07-21 20:35 UTC (permalink / raw)
  To: linux-nfs; +Cc: Malahal Naineni

The sizeof operator, when applied to a parameter declared to have array,
yields the size of the adjusted (pointer) type, even if the parameter
declaration specifies a length.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
---
 libnfs4acl/nfs4_ace_from_string.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libnfs4acl/nfs4_ace_from_string.c b/libnfs4acl/nfs4_ace_from_string.c
index 9d877fb..462fcc0 100644
--- a/libnfs4acl/nfs4_ace_from_string.c
+++ b/libnfs4acl/nfs4_ace_from_string.c
@@ -100,7 +100,7 @@ parse_alloc_fields(char *buf, char *fields[NUMFIELDS])
 	if (!buf)
 		return -EINVAL;
 
-	memset(fields, 0, sizeof(fields));
+	memset(fields, 0, sizeof(char *) * NUMFIELDS);
 
 	for (i = 0; buf[i] != '\0'; i++) {
 		if (buf[i] == ':')
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-08-05 20:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-21 20:35 [PATCH 1/2] nfs4-acl-tools: Fix segfault if format of the input file is incorrect Malahal Naineni
2011-07-21 20:35 ` [PATCH 2/2] nfs4-acl-tools: Don't call free_fields when memory isn't allocated Malahal Naineni
2011-07-26  6:54 ` [PATCH 1/2] nfs4-acl-tools: Fix segfault if format of the input file is incorrect Venkateswararao Jujjuri
2011-07-26 17:58   ` Malahal Naineni
2011-08-05 20:05     ` J. Bruce Fields
2011-08-05 20:50       ` Malahal Naineni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).