Skip to content

Commit 4d559ca

Browse files
committed
[skip ci] Use safe_emalloc() for php_poll_event allocation
1 parent e246a0d commit 4d559ca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ext/standard/io_poll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ PHP_METHOD(Io_Poll_Context, wait)
851851
RETURN_THROWS();
852852
}
853853

854-
php_poll_event *events = emalloc(sizeof(php_poll_event) * max_events);
854+
php_poll_event *events = safe_emalloc(max_events, sizeof(*events), 0);
855855
int num_events = php_poll_wait(intern->ctx, events, (int) max_events, timeout);
856856

857857
if (num_events < 0) {

0 commit comments

Comments
 (0)