shithub: libdvdcss

Download patch

ref: 2aca6d8b6702b30907b2a6761e7ab0cb94f9a927
parent: 6e7f5562752d19ece99b55576ef2cbfae4b1623e
author: Diego Biurrun <[email protected]>
date: Tue Nov 4 07:52:06 EST 2014

Fix calculation of cache filename length.

The calculation skipped some parts that are included in the filename.

--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -270,7 +270,8 @@
         /* Check that there is enough space for the cache directory path and the
          * block filename. The +1 are path separators and terminating null byte. */
         else if( strlen( psz_cache ) + 1 + DISC_TITLE_LENGTH + 1 +
-                 STRING_KEY_SIZE + CACHE_FILENAME_LENGTH + 1 > PATH_MAX )
+                 MANUFACTURING_DATE_LENGTH + 1 + STRING_KEY_SIZE + 1 +
+                 CACHE_FILENAME_LENGTH + 1 > PATH_MAX )
         {
             print_error( dvdcss, "cache directory name is too long" );
             return NULL;