Selaa lähdekoodia

smb_trans2: Fix use after free

fix cid #65536

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Hugo Beauzée-Luyssen 9 vuotta sitten
vanhempi
commit
64a4e44f2f
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  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");
                     BDSM_dbg("Error during FIND_NEXT request\n");
                     smb_stat_list_destroy(files);
                     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");
         BDSM_dbg("Error during FIND_FIRST request\n");
         smb_stat_list_destroy(files);
         smb_stat_list_destroy(files);
         smb_message_destroy(msg);
         smb_message_destroy(msg);
+        return NULL;
     }
     }
 
 
     return files;
     return files;