[vlc-commits] Win32: fix uninitialised variable and double free in drive letters mode

Hannes Domani git at videolan.org
Wed Mar 25 15:17:51 CET 2015


vlc/vlc-2.2 | branch: master | Hannes Domani <ssbssa at yahoo.de> | Fri Mar 13 18:01:23 2015 +0100| [7c28c94a6195074b30ed0c05a76296456684ed83] | committer: Jean-Baptiste Kempf

Win32: fix uninitialised variable and double free in drive letters mode

Close #14140

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 3ca2ce1e87a85a924c0f7ef45324d31c65a986cd)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=7c28c94a6195074b30ed0c05a76296456684ed83
---

 src/win32/filesystem.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/win32/filesystem.c b/src/win32/filesystem.c
index 7f29c8f..a6afcf0 100644
--- a/src/win32/filesystem.c
+++ b/src/win32/filesystem.c
@@ -149,6 +149,7 @@ DIR *vlc_opendir (const char *dirname)
         free (wpath);
         p_dir->wdir = NULL;
         p_dir->u.drives = GetLogicalDrives ();
+        p_dir->entry = NULL;
         return (void *)p_dir;
     }
 #endif
@@ -180,7 +181,10 @@ char *vlc_readdir (DIR *dir)
     {
         DWORD drives = p_dir->u.drives;
         if (drives == 0)
+        {
+            p_dir->entry = NULL;
             return NULL; /* end */
+        }
 
         unsigned int i;
         for (i = 0; !(drives & 1); i++)



More information about the vlc-commits mailing list