php-fpm segfaults (null passed to strstr)

 [2012-06-01 08:35 UTC] alp at rsu dot ru

Description:
------------
In sapi/fpm/fpm/fpm_status.c NULL can be passed to strstr, which leads to php-fpm crash with:
(gdb) bt
#0  __strstr_sse42 (s1=0x0, s2=<optimized out>) at ../sysdeps/x86_64/multiarch/strstr.c:175
#1  0x0000000000736d13 in fpm_status_handle_request () at /home/alp/build/php5-5.3.10/sapi/fpm/fpm/fpm_status.c:128
#2  0x000000000042b4ab in main (argc=11237155, argv=0x0) at /home/alp/build/php5-5.3.10/sapi/fpm/fpm/fpm_main.c:1809

The crash happens when monitoring software access php-fpm status page.


 [2012-06-01 08:46 UTC] laruence@php.net

the patch looks good, but it is better assign this to fat, and ask for his 
reviewing :) thanks

 [2012-06-01 08:49 UTC] fat@php.net

I'm on it.

I've found this bug few days ago and I was waiting to finitsh something in the 
fpm_status code to fix this bug.

I'll fix this now but I won't use the patch as there's something cleaner to check 
the presence of some parameters in the query string.

i'll try to push this patch this morning.

 [2012-06-01 09:31 UTC] fat@php.net

-Status: Assigned +Status: Closed

 [2012-06-01 09:31 UTC] fat@php.net

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.