From: Ilia Alshanetsky Date: Sun, 1 Jan 2006 20:12:55 +0000 (+0000) Subject: Added safety checks X-Git-Tag: php-5.1.2RC2~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=488500acfbaf276aa441c4999bff61c1af1e8ca3;p=php Added safety checks --- diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c index 557a109964..f6a0cab4d3 100644 --- a/sapi/apache2handler/php_functions.c +++ b/sapi/apache2handler/php_functions.c @@ -58,13 +58,11 @@ php_apache2_info_struct php_apache2_info; static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC) { - php_struct *ctx; + php_struct *ctx = SG(server_context); - if (!filename) { + if (!filename || !ctx || !ctx->r) { return NULL; } - - ctx = SG(server_context); return ap_sub_req_lookup_uri(filename, ctx->r, ctx->r->output_filters); }