libcli/smb: clang: Fix 'Array access results in a null pointer deref'
[garming/samba-autobuild/.git] / libcli / smb / smbXcli_base.c
index 37ae0a0e0e11bb2d1578536ced260132993edeb9..b0e8aabb72e7b70235a078b73c637da1f197ea41 100644 (file)
@@ -4327,7 +4327,7 @@ static void smbXcli_negprot_smb1_done(struct tevent_req *subreq)
                struct smbXcli_negprot_state);
        struct smbXcli_conn *conn = state->conn;
        struct iovec *recv_iov = NULL;
-       uint8_t *inhdr;
+       uint8_t *inhdr = NULL;
        uint8_t wct;
        uint16_t *vwv;
        uint32_t num_bytes;
@@ -4387,7 +4387,7 @@ static void smbXcli_negprot_smb1_done(struct tevent_req *subreq)
                                  NULL, /* pinbuf */
                                  expected, ARRAY_SIZE(expected));
        TALLOC_FREE(subreq);
-       if (tevent_req_nterror(req, status)) {
+       if (inhdr == NULL || tevent_req_nterror(req, status)) {
                return;
        }