mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Switch use of strtok() to gd_strtok_r()
This commit is contained in:
commit
a309dda777
3
NEWS
3
NEWS
@ -5,6 +5,9 @@ PHP NEWS
|
||||
- Fileinfo:
|
||||
. Fixed bug #67716 (Segfault in cdf.c). (CVE-2014-3587) (Remi)
|
||||
|
||||
- GD
|
||||
. Made fontFetch's path parser thread-safe. (Sara)
|
||||
|
||||
14 Aug 2014, PHP 5.6.0 Release Candidate 4
|
||||
|
||||
- COM:
|
||||
|
@ -390,9 +390,10 @@ static void *fontFetch (char **error, void *key)
|
||||
fontlist = gdEstrdup(a->fontlist);
|
||||
|
||||
/*
|
||||
* Must use gd_strtok_r else pointer corrupted by strtok in nested loop.
|
||||
* Must use gd_strtok_r becasuse strtok() isn't thread safe
|
||||
*/
|
||||
for (name = gd_strtok_r (fontlist, LISTSEPARATOR, &strtok_ptr); name; name = gd_strtok_r (0, LISTSEPARATOR, &strtok_ptr)) {
|
||||
char *strtok_ptr_path;
|
||||
/* make a fresh copy each time - strtok corrupts it. */
|
||||
path = gdEstrdup (fontsearchpath);
|
||||
|
||||
@ -408,7 +409,8 @@ static void *fontFetch (char **error, void *key)
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (dir = strtok (path, PATHSEPARATOR); dir; dir = strtok (0, PATHSEPARATOR)) {
|
||||
for (dir = gd_strtok_r (path, PATHSEPARATOR, &strtok_ptr_path); dir;
|
||||
dir = gd_strtok_r (0, PATHSEPARATOR, &strtok_ptr_path)) {
|
||||
if (!strcmp(dir, ".")) {
|
||||
TSRMLS_FETCH();
|
||||
#if HAVE_GETCWD
|
||||
|
Loading…
Reference in New Issue
Block a user