s4-libregistry: Make sure we don't dereference a NULL pointer.
authorAndreas Schneider <asn@samba.org>
Mon, 25 Feb 2013 14:01:18 +0000 (15:01 +0100)
committerDavid Disseldorp <ddiss@suse.de>
Tue, 5 Mar 2013 22:30:01 +0000 (23:30 +0100)
Reviewed-by: David Disseldorp <ddiss@samba.org>
source4/lib/registry/regf.c

index b6a586cf78bd6edad3909761c43edbd219683583..06476b940ee920474e079228a7acd2097420220c 100644 (file)
@@ -163,7 +163,9 @@ static DATA_BLOB hbin_alloc(struct regf_data *data, uint32_t size,
        struct hbin_block *hbin = NULL;
        unsigned int i;
 
-       *offset = 0;
+       if (offset != NULL) {
+               *offset = 0;
+       }
 
        if (size == 0)
                return data_blob(NULL, 0);