From: Volker Lendecke Date: Tue, 4 Feb 2020 13:03:48 +0000 (+0200) Subject: libsmb: Allow passing in NULL to smb2_create_blob_find() X-Git-Tag: ldb-2.1.1~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23db731593614c1427066091090fd13ccebed2aa;p=thirdparty%2Fsamba.git libsmb: Allow passing in NULL to smb2_create_blob_find() 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 Reviewed-by: Jeremy Allison --- diff --git a/libcli/smb/smb2_create_blob.c b/libcli/smb/smb2_create_blob.c index bb994f28e2f..57c7a9d1150 100644 --- a/libcli/smb/smb2_create_blob.c +++ b/libcli/smb/smb2_create_blob.c @@ -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];