libsmb: Allow passing in NULL to smb2_create_blob_find()
authorVolker Lendecke <vl@samba.org>
Tue, 4 Feb 2020 13:03:48 +0000 (15:03 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 7 Feb 2020 21:01:30 +0000 (21:01 +0000)
Will simplify callers a bit, and it does not change semantics
significantly. Zero create blobs won't find anything anyway.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb/smb2_create_blob.c

index bb994f28e2f881e4961cd339fe093bb7ced148fc..57c7a9d1150c4c469863a0166fa66a2afeffde4b 100644 (file)
@@ -213,6 +213,10 @@ struct smb2_create_blob *smb2_create_blob_find(const struct smb2_create_blobs *b
 {
        uint32_t i;
 
+       if (b == NULL) {
+               return NULL;
+       }
+
        for (i=0; i < b->num_blobs; i++) {
                if (strcmp(b->blobs[i].tag, tag) == 0) {
                        return &b->blobs[i];