Skip to content

Commit bdfe457

Browse files
committed
Port for for bug #68552
1 parent 7b18981 commit bdfe457

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ PHP NEWS
1010
buffer overflow). (Stas)
1111
. Fixed bug #67827 (broken detection of system crypt sha256/sha512 support).
1212
(ncopa at alpinelinux dot org)
13+
. Fixed bug #68942 (Use after free vulnerability in unserialize() with
14+
DateTimeZone). (Stas)
1315

16+
- Enchant:
17+
. Fixed bug #6855 (heap buffer overflow in enchant_broker_request_dict()).
18+
(Antony)
19+
1420
- SOAP:
1521
. Fixed bug #67427 (SoapServer cannot handle large messages)
1622
(brandt at docoloc dot de)

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)