[libdvdcss-devel] [PATCH 05/12] libdvdcss: Ensure that the pointer passed to strlen() is not NULL

Diego Biurrun <[email protected]> Tue, 11 Nov 2014 14:34:32 +0100
Newsgroups gmane.comp.video.videolan.libdvdcss,gmane.comp.video.videolan.libdvdcss.devel
Message-ID <[email protected]>
This fixes CID 75513.
---
 src/libdvdcss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 4c19c6d..027a32e 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -262,7 +262,7 @@ static char *set_cache_directory( dvdcss_t dvdcss )
 
     /* Check that there is enough space for the cache directory path and the
      * block filename. The +1 are path separators and terminating null byte. */
-    if( strlen( psz_cache ) + 1 + DISC_TITLE_LENGTH + 1 +
+    if( psz_cache && strlen( psz_cache ) + 1 + DISC_TITLE_LENGTH + 1 +
         MANUFACTURING_DATE_LENGTH + 1 + STRING_KEY_SIZE + 1 +
         CACHE_FILENAME_LENGTH + 1 > PATH_MAX )
     {
-- 
2.1.0

_______________________________________________
libdvdcss-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libdvdcss-devel