Skip to content

Commit 1015de3

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 03de7b0 + e029f8f commit 1015de3

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ PHP NEWS
3232
(Arnaud)
3333
. Fixed bug GH-19831 (function JIT may not deref property value). (Arnaud)
3434

35+
- GD:
36+
. FIxed GH-19955 (imagefttext() memory leak). (David Carlier)
37+
3538
- SimpleXML:
3639
. Fixed bug GH-19988 (zend_string_init with NULL pointer in simplexml (UB)).
3740
(nielsdos)

ext/gd/libgd/gdkanji.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ do_convert (unsigned char *to, unsigned char *from, const char *code)
368368
else
369369
error ("something happen");
370370
strcpy ((char *) to, (const char *) from);
371+
if (iconv_close (cd) != 0)
372+
error ("iconv_close() error");
371373
return;
372374
}
373375

ext/gd/tests/gh19955.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
GH-19955: (imagefttext() memory leak)
3+
--EXTENSIONS--
4+
gd
5+
--CREDITS--
6+
YuanchengJiang
7+
--FILE--
8+
<?php
9+
ini_set('error_reporting', E_ALL&~E_WARNING);
10+
$im = imagecreate(64, 32);
11+
imagefttext(imagecreate(8, 8), 0, 0, 0, 0, 255, __DIR__ . "/Tuffy.ttf", 'Ж');
12+
echo "OK"
13+
?>
14+
--EXPECT--
15+
OK

0 commit comments

Comments
 (0)