Skip to content

Commit 498eb8e

Browse files
committed
Fix #73533: Invalid memory access in php_libxml_xmlCheckUTF8
A string passed to `php_libxml_xmlCheckUTF8()` may be longer than 1<<31-1 bytes, so we're better using a `size_t`. Closes phpGH-6802.
1 parent 688e56d commit 498eb8e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ PHP NEWS
99
. Fixed bug #80024 (Duplication of info about inherited socket after pool
1010
removing). (Jakub Zelenka)
1111

12+
- LibXML:
13+
. Fixed bug #73533 (Invalid memory access in php_libxml_xmlCheckUTF8). (cmb)
14+
1215
- PDO_ODBC:
1316
. Fixed bug #80783 (PDO ODBC truncates BLOB records at every 256th byte).
1417
(cmb)

ext/libxml/libxml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ static PHP_FUNCTION(libxml_set_external_entity_loader)
11821182
/* {{{ Common functions shared by extensions */
11831183
int php_libxml_xmlCheckUTF8(const unsigned char *s)
11841184
{
1185-
int i;
1185+
size_t i;
11861186
unsigned char c;
11871187

11881188
for (i = 0; (c = s[i++]);) {

0 commit comments

Comments
 (0)