mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
MFB51: Fixed possible crash in apache_getenv()/apache_setenv() on invalid
parameters.
This commit is contained in:
parent
61d12ef9ec
commit
331253e7e6
1 changed files with 14 additions and 8 deletions
|
@ -264,9 +264,12 @@ PHP_FUNCTION(apache_setenv)
|
||||||
ctx = SG(server_context);
|
ctx = SG(server_context);
|
||||||
|
|
||||||
r = ctx->r;
|
r = ctx->r;
|
||||||
if (arg_count == 3 && Z_STRVAL_PP(walk_to_top)) {
|
if (arg_count == 3) {
|
||||||
while(r->prev) {
|
convert_to_boolean_ex(walk_to_top);
|
||||||
r = r->prev;
|
if (Z_LVAL_PP(walk_to_top)) {
|
||||||
|
while(r->prev) {
|
||||||
|
r = r->prev;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,9 +303,12 @@ PHP_FUNCTION(apache_getenv)
|
||||||
ctx = SG(server_context);
|
ctx = SG(server_context);
|
||||||
|
|
||||||
r = ctx->r;
|
r = ctx->r;
|
||||||
if (arg_count == 2 && Z_STRVAL_PP(walk_to_top)) {
|
if (arg_count == 2) {
|
||||||
while(r->prev) {
|
convert_to_boolean_ex(walk_to_top);
|
||||||
r = r->prev;
|
if (Z_LVAL_PP(walk_to_top)) {
|
||||||
|
while(r->prev) {
|
||||||
|
r = r->prev;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue