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

Jean-Baptiste Kempf jb at videolan.org
Tue Nov 11 14:35:49 CET 2014


LGTM.

On 07 Nov, Diego Biurrun wrote :
> ---
> 
> Same, this comes from Coverity.  Also, ahem, it's a regression I recently
> introduced ;)
> 
>  src/libdvdcss.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libdvdcss.c b/src/libdvdcss.c
> index 9e10095..d86b24a 100644
> --- a/src/libdvdcss.c
> +++ b/src/libdvdcss.c
> @@ -262,7 +262,7 @@ static char *set_cache_directory( struct dvdcss *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
> libdvdcss-devel at videolan.org
> https://mailman.videolan.org/listinfo/libdvdcss-devel

-- 
With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device


More information about the libdvdcss-devel mailing list