diff mbox

[ndctl] fix NULL pointer dereference in validate_namespace_options

Message ID x49vb6s7yaj.fsf@segfault.boston.devel.redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Moyer Jan. 17, 2016, 8:20 p.m. UTC
Hi,

Obvious thinko.  This is against the pending branch.

Cheers,
Jeff

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>

Comments

Dan Williams Jan. 17, 2016, 10:05 p.m. UTC | #1
On Sun, Jan 17, 2016 at 12:20 PM, Jeff Moyer <jmoyer@redhat.com> wrote:
> Hi,
>
> Obvious thinko.  This is against the pending branch.

Thanks Jeff!

A unit test is definitely needed before those bits move from pending to master.
diff mbox

Patch

diff --git a/builtin-xaction-namespace.c b/builtin-xaction-namespace.c
index 23ad8cc..c0a6a72 100644
--- a/builtin-xaction-namespace.c
+++ b/builtin-xaction-namespace.c
@@ -310,7 +310,7 @@  static int validate_namespace_options(struct ndctl_namespace *ndns,
 {
 	int rc = 0;
 
-	memset(&p, 0, sizeof(p));
+	memset(p, 0, sizeof(*p));
 
 	if (param.size)
 		p->size = parse_size64(param.size);