Skip to content

Commit cf7d8ea

Browse files
committed
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
2 parents 29a4e71 + bdfe457 commit cf7d8ea

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ext/enchant/enchant.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,13 +550,12 @@ PHP_FUNCTION(enchant_broker_request_dict)
550550

551551
d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag);
552552
if (d) {
553+
pos = pbroker->dictcnt++;
553554
if (pbroker->dictcnt) {
554555
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
555-
pos = pbroker->dictcnt++;
556556
} else {
557557
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
558558
pos = 0;
559-
pbroker->dictcnt++;
560559
}
561560

562561
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
@@ -607,14 +606,14 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
607606

608607
d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl);
609608
if (d) {
609+
pos = pbroker->dictcnt++;
610610
if (pbroker->dictcnt) {
611-
pos = pbroker->dictcnt++;
612611
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
613612
} else {
614613
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
615614
pos = 0;
616-
pbroker->dictcnt++;
617615
}
616+
618617
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
619618
dict->id = pos;
620619
dict->pbroker = pbroker;

0 commit comments

Comments
 (0)