Skip to content

Commit 70e51db

Browse files
committed
Merge branch 'PHP-5.6'
* PHP-5.6: update news Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) Port for for bug #68552 Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) - BFN Conflicts: ext/date/php_date.c
2 parents 625ab10 + c538a2e commit 70e51db

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
@@ -552,13 +552,12 @@ PHP_FUNCTION(enchant_broker_request_dict)
552552

553553
d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag);
554554
if (d) {
555+
pos = pbroker->dictcnt++;
555556
if (pbroker->dictcnt) {
556557
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
557-
pos = pbroker->dictcnt++;
558558
} else {
559559
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
560560
pos = 0;
561-
pbroker->dictcnt++;
562561
}
563562

564563
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
@@ -604,14 +603,14 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
604603

605604
d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl);
606605
if (d) {
606+
pos = pbroker->dictcnt++;
607607
if (pbroker->dictcnt) {
608-
pos = pbroker->dictcnt++;
609608
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
610609
} else {
611610
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
612611
pos = 0;
613-
pbroker->dictcnt++;
614612
}
613+
615614
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
616615
dict->id = pos;
617616
dict->pbroker = pbroker;

0 commit comments

Comments
 (0)