registry4: Fix CID 1034911 Dereference before null check
authorVolker Lendecke <vl@samba.org>
Sun, 18 Aug 2013 19:34:35 +0000 (19:34 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 18 Aug 2013 23:15:20 +0000 (11:15 +1200)
curbegin is always != NULL here (curend + 1) and is dereferenced by
strchr.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/lib/registry/local.c

index 4db8cc63ce0c475bc77cddb5c3427dfe0395dcdd..2afb65c7d599f69439f3af3e6d7ff0f061234233 100644 (file)
@@ -124,7 +124,7 @@ static WERROR local_open_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,