]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: Fix possible NULL deref in smbd_do_qfilepathinfo()
authorAndreas Schneider <asn@samba.org>
Mon, 9 Dec 2019 09:45:31 +0000 (10:45 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 10 Dec 2019 00:30:29 +0000 (00:30 +0000)
Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/trans2.c

index 9c77b32ee68b97fb6df2756078f7fb5f2dccd658..2cf669f4b4df80ca8df7813eeea96df7b60cab11 100644 (file)
@@ -5531,7 +5531,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
                {
                        char *nfname = NULL;
 
-                       if (!fsp->conn->sconn->using_smb2) {
+                       if (fsp == NULL || !fsp->conn->sconn->using_smb2) {
                                return NT_STATUS_INVALID_LEVEL;
                        }