]> granicus.if.org Git - php/commitdiff
Possible fix for bug #29764
authorIlia Alshanetsky <iliaa@php.net>
Wed, 6 Oct 2004 00:12:04 +0000 (00:12 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 6 Oct 2004 00:12:04 +0000 (00:12 +0000)
sapi/apache/php_apache.c

index a52e95d19b023ae444feaf757420ca0a74837e69..6aa96407a24394e00b8ff55a748b9a45554e532b 100644 (file)
@@ -524,9 +524,17 @@ PHP_FUNCTION(apache_get_modules)
        char *p;
        
        array_init(return_value);
+
+       if (!ap_loaded_modules) {
+               return;
+       }
        
        for (n = 0; ap_loaded_modules[n]; ++n) {
                char *s = (char *) ap_loaded_modules[n]->name;
+               if (!s) {
+                       continue;
+               }
+               
                if ((p = strchr(s, '.'))) {
                        add_next_index_stringl(return_value, s, (p - s), 1);
                } else {