]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb: client: compress: fix a potential issue of freeing an invalid pointer
authorQianqiang Liu <qianqiang.liu@163.com>
Fri, 13 Sep 2024 00:00:54 +0000 (08:00 +0800)
committerSteve French <stfrench@microsoft.com>
Sun, 15 Sep 2024 15:42:45 +0000 (10:42 -0500)
The dst pointer may not be initialized when calling kvfree(dst)

Fixes: 13b68d44990d9 ("smb: client: compress: LZ77 code improvements cleanup")
Signed-off-by: Qianqiang Liu <qianqiang.liu@163.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/compress.c

index 65d3d219e8bc54b672750caacee4e475b9c03ab5..daf84e39861cbec2f5760f06485860d4f7d82698 100644 (file)
@@ -318,7 +318,7 @@ int smb_compress(struct TCP_Server_Info *server, struct smb_rqst *rq, compress_s
 {
        struct iov_iter iter;
        u32 slen, dlen;
-       void *src, *dst;
+       void *src, *dst = NULL;
        int ret;
 
        if (!server || !rq || !rq->rq_iov || !rq->rq_iov->iov_base)