diff options
| author | Pierre Joye <pajoye@php.net> | 2011-07-28 10:52:45 +0000 |
|---|---|---|
| committer | Pierre Joye <pajoye@php.net> | 2011-07-28 10:52:45 +0000 |
| commit | 96b142795cf361ea078b248ba542f8261cdb0245 (patch) | |
| tree | 5d5e285527bec12008308f10aecefcf49978f49b | |
| parent | 7053100f3dc9e3c083b030cc4f574e8bc2430924 (diff) | |
| download | php-git-96b142795cf361ea078b248ba542f8261cdb0245.tar.gz | |
- Fix #55301 (url scanner part) check if malloc succeded
| -rw-r--r-- | ext/standard/url_scanner_ex.c | 7 | ||||
| -rw-r--r-- | ext/standard/url_scanner_ex.re | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index f9c017ff93..d883d4dfa3 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -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); diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index 7994925b1c..e7218a14f1 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -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); |
