shithub: libdvdcss

Download patch

ref: 100ac1a3762915042ee65b1bf370399966f61be5
parent: 22cb2d442fecf4dd8122347309dbf27ad79e5559
author: Petri Hintukainen <phintuka@gmail.com>
date: Fri Mar 11 07:07:03 EST 2016

Check for empty strings

--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -234,7 +234,7 @@
 
         /* Try looking in password file for home dir. */
         p_pwd = getpwuid(getuid());
-        if( p_pwd )
+        if( p_pwd && p_pwd[ 0 ] )
         {
             psz_home = p_pwd->pw_dir;
         }
@@ -248,7 +248,7 @@
         }
 
         /* Cache our keys in ${HOME}/.dvdcss/ */
-        if( psz_home )
+        if( psz_home && psz_home[ 0 ] )
         {
             int home_pos = 0;