From 138e97baf135fb0ae765d8899f564d6b10211830 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 24 Apr 2026 12:15:45 +0200 Subject: Fix a possible null-deref in sp_stream_wrapper_register `protocol_name` can be NULL if `zend_parse_parameters_ex` fails (it uses `ZEND_PARSE_PARAMS_QUIET`), but it was then unconditionally passed to `strcasecmp`. --- src/sp_wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/sp_wrapper.c b/src/sp_wrapper.c index 6b6c5cd..22b1d88 100644 --- a/src/sp_wrapper.c +++ b/src/sp_wrapper.c @@ -180,7 +180,7 @@ PHP_FUNCTION(sp_stream_wrapper_register) { if (!protocol_name || wrapper_is_whitelisted(protocol_name)) { // reject manual loading of "php" wrapper - if (!strcasecmp(ZSTR_VAL(protocol_name), "php") && sp_php_stream_is_filtered()) { + if (protocol_name && !strcasecmp(ZSTR_VAL(protocol_name), "php") && sp_php_stream_is_filtered()) { return; } -- cgit v1.3