Bug #68812 [Csd]: Unchecked return value
| From: | stas@php.net | Date: | Tue, 09 Jun 2015 22:39:43 +0000 |
| Subject: | Bug #68812 [Csd]: Unchecked return value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-193267@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68812&edit=1
ID: 68812
Updated by: stas@php.net
Reported by: bugreports at internot dot info
Summary: Unchecked return value
Status: Closed
Type: Bug
Package: Other web server
Operating System: Linux Ubuntu 14.04
PHP Version: master-Git-2015-01-12 (Git)
Assigned To: gwang
Block user comment: N
Private report: N
New Comment:
Please talk to me next time when (or even better, before) committing patches to 5.4. Otherwise they
may be missed when upmerging and packaging the release.
Previous Comments:
------------------------------------------------------------------------
[2015-06-09 12:02:31] cmb@php.net
The fix for this bug has been committed.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2015-06-08 19:52:19] gwang@php.net
Fix has been committed. You can apply following patch
diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
index baf0db3..a109909 100644
@@ -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;
}
------------------------------------------------------------------------
[2015-06-08 18:27:31] cmb@php.net
George, can you please have a look at this issue?
------------------------------------------------------------------------
[2015-01-12 15:48:45] bugreports at internot dot info
Description:
------------
Hi,
In /sapi/litespeed/lsapilib.c:
3114 pw = getpwnam( "nobody" );
is not checked against NULL, as it is everywhere else.
This may cause a null pointer dereference.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68812&edit=1