pajoye                                   Thu, 28 Jul 2011 10:52:45 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=313832

Log:
- Fix #55301 (url scanner part) check if malloc succeded

Bug: https://bugs.php.net/55301 (error getting bug information)
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/standard/url_scanner_ex.c
    U   php/php-src/branches/PHP_5_3/ext/standard/url_scanner_ex.re
    U   php/php-src/branches/PHP_5_4/ext/standard/url_scanner_ex.c
    U   php/php-src/branches/PHP_5_4/ext/standard/url_scanner_ex.re
    U   php/php-src/trunk/ext/standard/url_scanner_ex.c
    U   php/php-src/trunk/ext/standard/url_scanner_ex.re

Modified: php/php-src/branches/PHP_5_3/ext/standard/url_scanner_ex.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/url_scanner_ex.c  2011-07-28 
10:42:45 UTC (rev 313831)
+++ php/php-src/branches/PHP_5_3/ext/standard/url_scanner_ex.c  2011-07-28 
10:52:45 UTC (rev 313832)
@@ -57,9 +57,12 @@

        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);

Modified: php/php-src/branches/PHP_5_3/ext/standard/url_scanner_ex.re
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/url_scanner_ex.re 2011-07-28 
10:42:45 UTC (rev 313831)
+++ php/php-src/branches/PHP_5_3/ext/standard/url_scanner_ex.re 2011-07-28 
10:52:45 UTC (rev 313832)
@@ -55,9 +55,13 @@

        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);

Modified: php/php-src/branches/PHP_5_4/ext/standard/url_scanner_ex.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/standard/url_scanner_ex.c  2011-07-28 
10:42:45 UTC (rev 313831)
+++ php/php-src/branches/PHP_5_4/ext/standard/url_scanner_ex.c  2011-07-28 
10:52:45 UTC (rev 313832)
@@ -57,9 +57,12 @@

        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);

Modified: php/php-src/branches/PHP_5_4/ext/standard/url_scanner_ex.re
===================================================================
--- php/php-src/branches/PHP_5_4/ext/standard/url_scanner_ex.re 2011-07-28 
10:42:45 UTC (rev 313831)
+++ php/php-src/branches/PHP_5_4/ext/standard/url_scanner_ex.re 2011-07-28 
10:52:45 UTC (rev 313832)
@@ -55,9 +55,13 @@

        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);

Modified: php/php-src/trunk/ext/standard/url_scanner_ex.c
===================================================================
--- php/php-src/trunk/ext/standard/url_scanner_ex.c     2011-07-28 10:42:45 UTC 
(rev 313831)
+++ php/php-src/trunk/ext/standard/url_scanner_ex.c     2011-07-28 10:52:45 UTC 
(rev 313832)
@@ -57,9 +57,12 @@

        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);

Modified: php/php-src/trunk/ext/standard/url_scanner_ex.re
===================================================================
--- php/php-src/trunk/ext/standard/url_scanner_ex.re    2011-07-28 10:42:45 UTC 
(rev 313831)
+++ php/php-src/trunk/ext/standard/url_scanner_ex.re    2011-07-28 10:52:45 UTC 
(rev 313832)
@@ -55,9 +55,13 @@

        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);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to