From: Jeremy Allison Date: Mon, 25 Mar 2019 18:13:24 +0000 (-0700) Subject: s3: net: Harden act_val_hex() act_val_sz() against errors. X-Git-Tag: tdb-1.4.1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3bfad39d64eab0e3a9218182b34385c2a397ff5;p=thirdparty%2Fsamba.git s3: net: Harden act_val_hex() act_val_sz() against errors. Found by Michael Hanselmann using fuzzing tools BUG: https://bugzilla.samba.org/show_bug.cgi?id=13842 Signed-off-by: Jeremy Allison Reviewed-by: Andrew Bartlett --- diff --git a/source3/registry/reg_parse.c b/source3/registry/reg_parse.c index 3093e6acf76..caf2a063b02 100644 --- a/source3/registry/reg_parse.c +++ b/source3/registry/reg_parse.c @@ -117,6 +117,7 @@ static bool act_val_hex(struct reg_parse* p, cbuf* value, bool cont) cbuf_swapptr(p->valblob, &dst, dlen); } else { DEBUG(0, ("iconvert_talloc failed\n")); + return false; } talloc_free(dst); } @@ -166,6 +167,7 @@ static bool act_val_sz(struct reg_parse* p, cbuf* value, bool cont) } else { DEBUG(0, ("convert_string_talloc failed: >%s<\n" "use it as is\t", src)); + return false; } talloc_free(dst);