Skip to content

Commit c6b7f6c

Browse files
committed
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Fix #72595: php_output_handler_append illegal write access
2 parents b9ae73e + a942cf5 commit c6b7f6c

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
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2021, PHP 8.0.10
44

5+
- Core:
6+
. Fixed bug #72595 (php_output_handler_append illegal write access). (cmb)
7+
58
- Standard:
69
. Fixed bug #72146 (Integer overflow on substr_replace). (cmb)
710

main/output.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ static inline int php_output_handler_append(php_output_handler *handler, const p
896896
size_t grow_buf = PHP_OUTPUT_HANDLER_INITBUF_SIZE(buf->used - (handler->buffer.size - handler->buffer.used));
897897
size_t grow_max = MAX(grow_int, grow_buf);
898898

899-
handler->buffer.data = erealloc(handler->buffer.data, handler->buffer.size + grow_max);
899+
handler->buffer.data = safe_erealloc(handler->buffer.data, 1, handler->buffer.size, grow_max);
900900
handler->buffer.size += grow_max;
901901
}
902902
memcpy(handler->buffer.data + handler->buffer.used, buf->data, buf->used);

0 commit comments

Comments
 (0)