diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2014-02-17 17:59:18 +0400 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2014-02-17 17:59:18 +0400 |
| commit | 2b9b9afa7a9a66f9c80013ce4121183bdff434e8 (patch) | |
| tree | 6fa09b93653af14de10c02215632e5cc458cf60a /ext/standard/html.c | |
| parent | 50661690709630bd5dcea599bb0f276083292921 (diff) | |
| download | php-git-2b9b9afa7a9a66f9c80013ce4121183bdff434e8.tar.gz | |
Use better data structures (incomplete)
Diffstat (limited to 'ext/standard/html.c')
| -rw-r--r-- | ext/standard/html.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/html.c b/ext/standard/html.c index 402b3aaac5..8a9da90ec4 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -1277,7 +1277,7 @@ PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldle * In HTML5, entities may take up to 33 bytes */ if (len > maxlen - 40) { /* maxlen can never be smaller than 128 */ //??? replaced = safe_erealloc(replaced, maxlen , 1, 128 + 1); - replaced = STR_EREALLOC(replaced, maxlen + 128); + replaced = STR_REALLOC(replaced, maxlen + 128, 0); maxlen += 128; } @@ -1410,7 +1410,7 @@ encode_amp: if (maxlen - len < ent_len + 2 /* & and ; */) { /* ent_len < oldlen, which is certainly <= SIZE_MAX/2 */ //??? replaced = safe_erealloc(replaced, maxlen, 1, ent_len + 128 + 1); - replaced = STR_EREALLOC(replaced, maxlen + ent_len + 128); + replaced = STR_REALLOC(replaced, maxlen + ent_len + 128, 0); maxlen += ent_len + 128; } replaced->val[len++] = '&'; |
