Skip to content

Instantly share code, notes, and snippets.

@nielsdos
Created June 7, 2024 21:39
Show Gist options
  • Save nielsdos/0d4f15f57ad984944249621e2670a50c to your computer and use it in GitHub Desktop.
Save nielsdos/0d4f15f57ad984944249621e2670a50c to your computer and use it in GitHub Desktop.
diff --git a/main/streams/cast.c b/main/streams/cast.c
index 238212c745..b93db2f6d3 100644
--- a/main/streams/cast.c
+++ b/main/streams/cast.c
@@ -61,8 +61,12 @@ FILE *fopencookie(void *cookie, const char *mode, cookie_io_functions_t *funcs)
static int stream_cookie_reader(void *cookie, char *buffer, int size)
{
int ret;
-
- ret = php_stream_read((php_stream*)cookie, buffer, size);
+ zend_try {
+ ret = php_stream_read((php_stream*)cookie, buffer, size);
+ } zend_catch {
+ ret = 0;
+ // XXX: Should propagate bailout here but we can't!!!
+ } zend_end_try();
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment