summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2015-02-17 06:53:48 +0100
committerStanislav Malyshev <stas@php.net>2015-02-17 06:53:48 +0100
commitcf7d8eabcc998bf4b60d4607de4942081dd2b895 (patch)
tree40e8d5408a21f5e06c6a60275bcf176e32b734fa
parent29a4e710de6a73341da3d268343fdfc072ba682a (diff)
parentbdfe457a2c1b47209e32783b3a6447e81baf179a (diff)
downloadphp-git-cf7d8eabcc998bf4b60d4607de4942081dd2b895.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Port for for bug #68552 Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) - BFN
-rw-r--r--ext/enchant/enchant.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index 6ec02cdf84..d7c115e366 100644
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -550,13 +550,12 @@ PHP_FUNCTION(enchant_broker_request_dict)
d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag);
if (d) {
+ pos = pbroker->dictcnt++;
if (pbroker->dictcnt) {
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
- pos = pbroker->dictcnt++;
} else {
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
pos = 0;
- pbroker->dictcnt++;
}
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
@@ -607,14 +606,14 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl);
if (d) {
+ pos = pbroker->dictcnt++;
if (pbroker->dictcnt) {
- pos = pbroker->dictcnt++;
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
} else {
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
pos = 0;
- pbroker->dictcnt++;
}
+
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
dict->id = pos;
dict->pbroker = pbroker;