]> granicus.if.org Git - php/commitdiff
MFH: Added safety checks
authorIlia Alshanetsky <iliaa@php.net>
Sun, 1 Jan 2006 20:14:06 +0000 (20:14 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 1 Jan 2006 20:14:06 +0000 (20:14 +0000)
sapi/apache2handler/php_functions.c

index 595d2c03fee10acb4555d4a654ece21bf4438ea1..fa9908248921b276cf5043c86138e02243b89411 100644 (file)
@@ -56,13 +56,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);
 }