]> Git Repo - linux.git/commitdiff
smb2: fix uninitialized variable bug in smb2_ioctl_query_info
authorGustavo A. R. Silva <[email protected]>
Tue, 9 Oct 2018 22:02:20 +0000 (00:02 +0200)
committerSteve French <[email protected]>
Wed, 24 Oct 2018 02:16:05 +0000 (21:16 -0500)
There is a potential execution path in which variable *resp_buftype*
is passed as an argument to function free_rsp_buf(), in which it is
used in a comparison without being properly initialized previously.

Fix this by initializing variable *resp_buftype* to CIFS_NO_BUFFER
in order to avoid unpredictable or unintended results.

Addresses-Coverity-ID: 1473971 ("Uninitialized scalar variable")
Fixes: c5d25bdb2967 ("cifs: add IOCTL for QUERY_INFO passthrough to userspace")
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Steve French <[email protected]>
Reviewed-by: Ronnie Sahlberg <[email protected]>
fs/cifs/smb2ops.c

index c6c6450d0f38f3f3b661aef479ee68c1f6dfc0d6..8472cb0ae06c71e146430587af36d5624d7dbd45 100644 (file)
@@ -1133,7 +1133,7 @@ smb2_ioctl_query_info(const unsigned int xid,
        struct smb_rqst rqst;
        struct kvec iov[1];
        struct kvec rsp_iov;
-       int resp_buftype;
+       int resp_buftype = CIFS_NO_BUFFER;
        struct smb2_query_info_rsp *rsp = NULL;
        void *buffer;
 
This page took 0.059623 seconds and 4 git commands to generate.