Skip to content

ext/zlib: refactor filter creation to do parameter validation#22313

Open
Girgias wants to merge 2 commits into
php:masterfrom
Girgias:2026-06-zlib-stream-filter
Open

ext/zlib: refactor filter creation to do parameter validation#22313
Girgias wants to merge 2 commits into
php:masterfrom
Girgias:2026-06-zlib-stream-filter

Conversation

@Girgias

@Girgias Girgias commented Jun 14, 2026

Copy link
Copy Markdown
Member

No description provided.

Comment thread ext/zlib/zlib_filter.c
/* Memory Level (1 - 9) */
const zend_long memory = zval_try_get_long(memory_zv, &failed);
if (UNEXPECTED(failed)) {
php_error_docref(NULL, E_WARNING, "Window size must be of type int, %s given", zend_zval_type_name(memory_zv));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likely a typo (copy / paste ?) in the message

Comment thread ext/zlib/zlib_filter.c

/* Save configuration for reset */
data->windowBits = windowBits;
php_zlib_filter_data *data = php_zlib_filter_data_new(persistent);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you still need a NULL check here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants