mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed possible crash in apache_getenv()/apache_setenv() on invalid
parameters.
This commit is contained in:
parent
6d8c69e3cb
commit
a5e15f2e1c
2 changed files with 16 additions and 8 deletions
|
@ -264,10 +264,13 @@ PHP_FUNCTION(apache_setenv)
|
|||
ctx = SG(server_context);
|
||||
|
||||
r = ctx->r;
|
||||
if (arg_count == 3 && Z_STRVAL_PP(walk_to_top)) {
|
||||
while(r->prev) {
|
||||
r = r->prev;
|
||||
}
|
||||
if (arg_count == 3) {
|
||||
convert_to_boolean_ex(walk_to_top);
|
||||
if (Z_LVAL_PP(walk_to_top)) {
|
||||
while(r->prev) {
|
||||
r = r->prev;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
convert_to_string_ex(variable);
|
||||
|
@ -300,10 +303,13 @@ PHP_FUNCTION(apache_getenv)
|
|||
ctx = SG(server_context);
|
||||
|
||||
r = ctx->r;
|
||||
if (arg_count == 2 && Z_STRVAL_PP(walk_to_top)) {
|
||||
while(r->prev) {
|
||||
r = r->prev;
|
||||
}
|
||||
if (arg_count == 2) {
|
||||
convert_to_boolean_ex(walk_to_top);
|
||||
if (Z_LVAL_PP(walk_to_top)) {
|
||||
while(r->prev) {
|
||||
r = r->prev;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
convert_to_string_ex(variable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue