Skip to content

Commit acdab8f

Browse files
author
Ilia Alshanetsky
committed
MFH: Added safety checks
1 parent 82fc47e commit acdab8f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sapi/apache2handler/php_functions.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,11 @@ php_apache2_info_struct php_apache2_info;
5858

5959
static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC)
6060
{
61-
php_struct *ctx;
61+
php_struct *ctx = SG(server_context);
6262

63-
if (!filename) {
63+
if (!filename || !ctx || !ctx->r) {
6464
return NULL;
6565
}
66-
67-
ctx = SG(server_context);
6866

6967
return ap_sub_req_lookup_uri(filename, ctx->r, ctx->r->output_filters);
7068
}

0 commit comments

Comments
 (0)