Skip to content

Commit a5b6978

Browse files
committed
not safe for persistent streams
1 parent 42ade33 commit a5b6978

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ext/zlib/zlib_filter.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,11 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
270270
php_zlib_filter_data *data;
271271
int status;
272272

273+
if (persistent) {
274+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "this filter is not safe to use with a persistent stream");
275+
return NULL;
276+
}
277+
273278
/* Create this filter */
274279
data = ecalloc(1, sizeof(php_zlib_filter_data));
275280

@@ -356,7 +361,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
356361
case IS_DOUBLE:
357362
case IS_LONG:
358363
tmpzval = &filterparams;
359-
factory_setlevel:
364+
factory_setlevel:
360365
/* Set compression level within reason (-1 == default, 0 == none, 1-9 == least to most compression */
361366
SEPARATE_ZVAL(tmpzval);
362367
convert_to_long_ex(tmpzval);

0 commit comments

Comments
 (0)