summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2005-03-29 04:02:03 (GMT)
committerSara Golemon <pollita@php.net>2005-03-29 04:02:03 (GMT)
commit29ede46872a2d3b79839359a25b2136ca8c92896 (patch)
tree9a65836a047417914309da37c878e4df64771098 /main
parent1a356bc40ed6d230a93fc8f32159df03eab0dbc4 (diff)
downloadphp-29ede46872a2d3b79839359a25b2136ca8c92896.tar.gz
BugFix #31137 stream_filter_remove() segfaults when stream already closed
Diffstat (limited to 'main')
-rw-r--r--main/streams/filter.c5
-rw-r--r--main/streams/php_stream_filter_api.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/main/streams/filter.c b/main/streams/filter.c
index 37ab4c1..dc59614 100644
--- a/main/streams/filter.c
+++ b/main/streams/filter.c
@@ -499,6 +499,11 @@ PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, in
} else {
filter->chain->tail = filter->prev;
}
+
+ if (filter->rsrc_id > 0) {
+ zend_list_delete(filter->rsrc_id);
+ }
+
if (call_dtor) {
php_stream_filter_free(filter TSRMLS_CC);
return NULL;
diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h
index 6ee8192..115fe24 100644
--- a/main/streams/php_stream_filter_api.h
+++ b/main/streams/php_stream_filter_api.h
@@ -117,6 +117,9 @@ struct _php_stream_filter {
/* buffered buckets */
php_stream_bucket_brigade buffer;
+
+ /* filters are auto_registered when they're applied */
+ int rsrc_id;
};
/* stack filter onto a stream */