Bug #66481 Segfaults on session_name()#561
Bug #66481 Segfaults on session_name()#561conormcd wants to merge 1 commit intophp:masterfrom conormcd:bug-66481
Conversation
|
there are lots codes using PS(session_name) directly, so I don't think this fix is very okey. I think the problem should be fixed in the "setting" stage. if a empty session name is set. we should restore to default value.. |
|
Yeah, wat @laruence said ... |
|
I guess that makes sense. I'll have another crack at it in the morning then. |
|
PR updated and description above changed to match that in the commit message. |
If the previous value of session.name was NULL then any call to session_name($string) would result in a segmentation fault. This changes the behaviour to set the value of session.name to "PHPSESSID" if a blank value is given in php.ini or via -d on the command line. There is already protection against setting it to NULL via session_name() or ini_set().
|
Newer patch(?) looks ok to me. |
|
Merged. Thank you. |
|
Excellent! Thanks. :) |
|
@conormcd @yohgaki sorry, but the fix is still no completely right, 1. it hard code the default value in the function. 2. we don't need to set the default value manually, we can simply return failure 3. should complain the wrong value set(let the user aware what he did is wrong). I will revert the fix @yohgaki merged, and make another one... thanks |
|
@conormcd committed, thanks for your help , could you please close this issue :) |
If the previous value of session.name was NULL then any call to
session_name($string) would result in a segmentation fault.
This changes the behaviour to set the value of session.name to
"PHPSESSID" if a blank value is given in php.ini or via -d on the
command line. There is already protection against setting it to NULL via
session_name() or ini_set().