util: Fix a possible null pointer dereference
authorAndreas Schneider <asn@samba.org>
Wed, 22 Jun 2016 07:17:07 +0000 (09:17 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 22 Jun 2016 17:25:20 +0000 (19:25 +0200)
Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/talloc_report.c

index 9b98347e97c0279d72c8a88b7ea59031766db9c8..018d9ab6570bb4ca12002a97aec0902428f47ed0 100644 (file)
@@ -40,6 +40,9 @@ static char *talloc_vasprintf_append_largebuf(char *buf, ssize_t *pstr_len,
        if (buf == NULL) {
                return NULL;
        }
+       if (fmt == NULL) {
+               return NULL;
+       }
        buflen = talloc_get_size(buf);
 
        if (buflen > str_len) {