]> git.sesse.net Git - vlc/commitdiff
Fix one potential NULL-deref on invalid plugin cache
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 13 Aug 2011 20:11:24 +0000 (23:11 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 13 Aug 2011 20:11:24 +0000 (23:11 +0300)
Zero-length strings are loaded as NULL. There are probably quite a few
other similar failure cases :( I have not investigated.

src/modules/cache.c

index 90859cca1c825ec1bed71fa70c5c5ddb63c0f6b4..bf3ce4b137a752eddd9035e0c725515f93acceb4 100644 (file)
@@ -270,6 +270,8 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
 
         /* Load common info */
         LOAD_STRING(path);
+        if (path == NULL)
+            goto error;
         LOAD_IMMEDIATE(st.st_mtime);
         LOAD_IMMEDIATE(st.st_size);