projects
/
php
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62e2973
)
Fixed possible crash (pcre cache must keep permanent strings)
author
Dmitry Stogov
<dmitry@zend.com>
Tue, 23 Dec 2014 11:38:30 +0000
(14:38 +0300)
committer
Dmitry Stogov
<dmitry@zend.com>
Tue, 23 Dec 2014 11:38:30 +0000
(14:38 +0300)
ext/pcre/php_pcre.c
patch
|
blob
|
history
diff --git
a/ext/pcre/php_pcre.c
b/ext/pcre/php_pcre.c
index d3eb4d49fea8e8b065ef4d38a1d9511dc85e656f..5701ae1a0c9e09ca4033f973a45569aa2165833d 100644
(file)
--- a/
ext/pcre/php_pcre.c
+++ b/
ext/pcre/php_pcre.c
@@
-439,7
+439,11
@@
PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
new_entry.preg_options = poptions;
new_entry.compile_options = coptions;
#if HAVE_SETLOCALE
- new_entry.locale = BG(locale_string) ? zend_string_dup(BG(locale_string), 1) : NULL;
+ new_entry.locale = BG(locale_string) ?
+ ((GC_FLAGS(BG(locale_string)) & IS_STR_PERSISTENT) ?
+ zend_string_copy(BG(locale_string)) :
+ zend_string_init(BG(locale_string)->val, BG(locale_string)->len, 1)) :
+ NULL;
new_entry.tables = tables;
#endif