Skip to content

Commit 11a1feb

Browse files
nielsdosGirgias
authored andcommitted
Fix missing check for xmlTextWriterEndElement
xmlTextWriterEndElement returns -1 if the call fails. There was already a check for retval, but the return value wasn't assigned to retval. The other caller of xmlTextWriterEndElement is in xmlwriter_write_element_ns, which does the check correctly. Closes GH-10324 Signed-off-by: George Peter Banyard <girgias@php.net>
1 parent 4bbbe6d commit 11a1feb

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
@@ -53,6 +53,9 @@ PHP NEWS
5353
- TSRM:
5454
. Fixed Windows shmget() wrt. IPC_PRIVATE. (Tyson Andre)
5555

56+
- XMLWriter
57+
. Fix missing check for xmlTextWriterEndElement (nielsdos)
58+
5659
05 Jan 2023, PHP 8.1.14
5760

5861
- Core:

ext/xmlwriter/php_xmlwriter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ PHP_FUNCTION(xmlwriter_write_element)
449449
if (retval == -1) {
450450
RETURN_FALSE;
451451
}
452-
xmlTextWriterEndElement(ptr);
452+
retval = xmlTextWriterEndElement(ptr);
453453
if (retval == -1) {
454454
RETURN_FALSE;
455455
}

0 commit comments

Comments
 (0)