From: Volker Lendecke Date: Sun, 18 Aug 2013 19:34:35 +0000 (+0000) Subject: registry4: Fix CID 1034911 Dereference before null check X-Git-Tag: talloc-2.1.0~145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f82daa054ad95c6b1ae5cfce1efb6dc461389bc9;p=thirdparty%2Fsamba.git registry4: Fix CID 1034911 Dereference before null check curbegin is always != NULL here (curend + 1) and is dereferenced by strchr. Signed-off-by: Volker Lendecke Reviewed-by: Andrew Bartlett --- diff --git a/source4/lib/registry/local.c b/source4/lib/registry/local.c index 79c398b68a9..4db8cc63ce0 100644 --- a/source4/lib/registry/local.c +++ b/source4/lib/registry/local.c @@ -233,7 +233,7 @@ static WERROR local_create_key(TALLOC_CTX *mem_ctx, break; curbegin = curend + 1; curend = strchr(curbegin, '\\'); - } while (curbegin != NULL && curbegin[0] != '\0'); + } while (curbegin[0] != '\0'); talloc_free(orig); *result = reg_import_hive_key(local_parent->global.context, curkey,