Skip to content

Commit 7ab5c59

Browse files
committed
Fix bug #66182 exit in stream filter produces segfault
Unfortunately, a segv caused by exit cannot be tested reliably.
1 parent 1ec83d4 commit 7ab5c59

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PHP NEWS
66
. Fixed bug #61019 (Out of memory on command stream_get_contents). (Mike)
77
. Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace
88
UNIX sockets). (Mike)
9+
. Fixed bug #66182 (exit in stream filter produces segfault). (Mike)
910

1011
- Embed:
1112
. Fixed bug #65715 (php5embed.lib isn't provided anymore). (Anatol)

ext/standard/user_filters.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ php_stream_filter_status_t userfilter_filter(
180180
zval zpropname;
181181
int call_result;
182182

183+
/* the userfilter object probably doesn't exist anymore */
184+
if (CG(unclean_shutdown)) {
185+
return ret;
186+
}
187+
183188
if (FAILURE == zend_hash_find(Z_OBJPROP_P(obj), "stream", sizeof("stream"), (void**)&zstream)) {
184189
/* Give the userfilter class a hook back to the stream */
185190
ALLOC_INIT_ZVAL(zstream);

0 commit comments

Comments
 (0)