diff options
| author | jvoisin | 2026-04-24 12:15:45 +0200 |
|---|---|---|
| committer | jvoisin | 2026-04-24 12:15:45 +0200 |
| commit | 138e97baf135fb0ae765d8899f564d6b10211830 (patch) | |
| tree | 70e79e4f0eb4f8d98ac563a4dee6ec15cda51f57 /src/sp_wrapper.c | |
| parent | 314b10154495b91eca684124275407b8186bb762 (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`.
Diffstat (limited to 'src/sp_wrapper.c')
| -rw-r--r-- | src/sp_wrapper.c | 2 |
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 | ||
