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

index 557a109964b3650884f66c3eeea6b0e3c557208e..f6a0cab4d3b954865f14868c4770d44e40d9dca6 100644 (file)
@@ -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);
 }