]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smb2_server: Check status codes (CID 1474441)
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 6 Oct 2023 02:46:34 +0000 (15:46 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 13 Oct 2023 02:18:31 +0000 (02:18 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/smb2_server.c

index 034370ffcfd244cdbff6203dccb0f689d95a3b87..67e271db0411a6b813a07027bba4768b4ec964c0 100644 (file)
@@ -516,11 +516,11 @@ static NTSTATUS smbd_smb2_inbuf_parse_compound(struct smbXsrv_connection *xconn,
 
                        status = smb2srv_session_lookup_conn(xconn, uid, now,
                                                             &s);
-                       if (s == NULL) {
+                       if (!NT_STATUS_IS_OK(status)) {
                                status = smb2srv_session_lookup_global(xconn->client,
                                                                       uid, req, &s);
                        }
-                       if (s == NULL) {
+                       if (!NT_STATUS_IS_OK(status)) {
                                DEBUG(1, ("invalid session[%llu] in "
                                          "SMB2_TRANSFORM header\n",
                                           (unsigned long long)uid));