summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2026-04-24 12:15:45 +0200
committerjvoisin2026-04-24 12:15:45 +0200
commit138e97baf135fb0ae765d8899f564d6b10211830 (patch)
tree70e79e4f0eb4f8d98ac563a4dee6ec15cda51f57
parent314b10154495b91eca684124275407b8186bb762 (diff)
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`.
-rw-r--r--src/sp_wrapper.c2
1 files changed, 1 insertions, 1 deletions
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) {
180 if (!protocol_name || wrapper_is_whitelisted(protocol_name)) { 180 if (!protocol_name || wrapper_is_whitelisted(protocol_name)) {
181 181
182 // reject manual loading of "php" wrapper 182 // reject manual loading of "php" wrapper
183 if (!strcasecmp(ZSTR_VAL(protocol_name), "php") && sp_php_stream_is_filtered()) { 183 if (protocol_name && !strcasecmp(ZSTR_VAL(protocol_name), "php") && sp_php_stream_is_filtered()) {
184 return; 184 return;
185 } 185 }
186 186