]> granicus.if.org Git - php/commitdiff
Fixed Buf #68812 Unchecked return value.
authorGeorge Wang <gwang@php.net>
Mon, 8 Jun 2015 19:38:59 +0000 (15:38 -0400)
committerGeorge Wang <gwang@php.net>
Mon, 8 Jun 2015 19:46:40 +0000 (15:46 -0400)
sapi/litespeed/lsapilib.c

index 699e86398a5ff8c30e07f513ad981bd6af638f5f..1abebe1d65f723229db89f79a1de9cd904881b2b 100644 (file)
@@ -3131,10 +3131,20 @@ static int lsapi_initSuEXEC()
     if ( !s_defaultUid || !s_defaultGid )
     {
         pw = getpwnam( "nobody" );
-        if ( !s_defaultUid )
-            s_defaultUid = pw->pw_uid;
-        if ( !s_defaultGid )
-            s_defaultGid = pw->pw_gid;
+        if ( pw )
+        {
+            if ( !s_defaultUid )
+                s_defaultUid = pw->pw_uid;
+            if ( !s_defaultGid )
+                s_defaultGid = pw->pw_gid;
+        }
+        else
+        {
+            if ( !s_defaultUid )
+                s_defaultUid = 10000;
+            if ( !s_defaultGid )
+                s_defaultGid = 10000;
+        }
     }
     return 0;
 }