]> granicus.if.org Git - php/commitdiff
- Fix #55301 (url scanner part) check if malloc succeded
authorPierre Joye <pajoye@php.net>
Thu, 28 Jul 2011 10:52:45 +0000 (10:52 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 28 Jul 2011 10:52:45 +0000 (10:52 +0000)
ext/standard/url_scanner_ex.c
ext/standard/url_scanner_ex.re

index f9c017ff93b77905258f73a0581cea40ca16c2eb..d883d4dfa32931a5d914d7253092fe71a57ae3bc 100644 (file)
@@ -57,9 +57,12 @@ static PHP_INI_MH(OnUpdateTags)
        
        if (ctx->tags)
                zend_hash_destroy(ctx->tags);
-       else
+       else {
                ctx->tags = malloc(sizeof(HashTable));
-       
+               if (!ctx->tags) {
+                       return FAILURE;
+               }
+       }
        zend_hash_init(ctx->tags, 0, NULL, NULL, 1);
        
        for (key = php_strtok_r(tmp, ",", &lasts);
index 7994925b1c08049a9b7e3d3aa3119f3adf2f47c3..e7218a14f1f542b8fcde91267bf0c4e753bf9eb1 100644 (file)
@@ -55,9 +55,13 @@ static PHP_INI_MH(OnUpdateTags)
        
        if (ctx->tags)
                zend_hash_destroy(ctx->tags);
-       else
+       else {
                ctx->tags = malloc(sizeof(HashTable));
-       
+               if (!ctx->tags) {
+                       return FAILURE;
+               }
+       }
+
        zend_hash_init(ctx->tags, 0, NULL, NULL, 1);
        
        for (key = php_strtok_r(tmp, ",", &lasts);