[vlc-commits] Fix one potential NULL-deref on invalid plugin cache

Rémi Denis-Courmont git at videolan.org
Sat Aug 13 22:13:19 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug 13 23:11:24 2011 +0300| [a94e6eb9d2f5079983a5e9293af2d40b86f50aac] | committer: Rémi Denis-Courmont

Fix one potential NULL-deref on invalid plugin cache

Zero-length strings are loaded as NULL. There are probably quite a few
other similar failure cases :( I have not investigated.

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

 src/modules/cache.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/modules/cache.c b/src/modules/cache.c
index 90859cc..bf3ce4b 100644
--- a/src/modules/cache.c
+++ b/src/modules/cache.c
@@ -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);
 



More information about the vlc-commits mailing list