[libdvdcss-devel] Check for empty strings

Petri Hintukainen git at videolan.org
Fri Mar 11 11:08:29 CET 2016


libdvdcss | branch: master | Petri Hintukainen <phintuka at gmail.com> | Fri Mar 11 12:07:03 2016 +0200| [100ac1a3762915042ee65b1bf370399966f61be5] | committer: Petri Hintukainen

Check for empty strings

> http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=100ac1a3762915042ee65b1bf370399966f61be5
---

 src/libdvdcss.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 408ec2f..ac90030 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -234,7 +234,7 @@ static int set_cache_directory( dvdcss_t dvdcss )
 
         /* 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 @@ static int set_cache_directory( dvdcss_t dvdcss )
         }
 
         /* Cache our keys in ${HOME}/.dvdcss/ */
-        if( psz_home )
+        if( psz_home && psz_home[ 0 ] )
         {
             int home_pos = 0;
 



More information about the libdvdcss-devel mailing list