浏览代码

smb_trans2: Fix use after free

fix cid #65536

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Hugo Beauzée-Luyssen 9 年之前
父节点
当前提交
64a4e44f2f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/smb_trans2.c

+ 2 - 1
src/smb_trans2.c

@@ -367,7 +367,7 @@ smb_file  *smb_find(smb_session *s, smb_tid tid, const char *pattern)
                 {
                     BDSM_dbg("Error during FIND_NEXT request\n");
                     smb_stat_list_destroy(files);
-                    end_of_search = true;
+                    return NULL;
                 }
             }
         }
@@ -382,6 +382,7 @@ smb_file  *smb_find(smb_session *s, smb_tid tid, const char *pattern)
         BDSM_dbg("Error during FIND_FIRST request\n");
         smb_stat_list_destroy(files);
         smb_message_destroy(msg);
+        return NULL;
     }
 
     return files;