mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix unreachable code in URL output handler (#19056)
Since `ZSTR_LEN()` returns a `size_t` (unsigned integer), the value can only be either "not equal to 0" or "equal to 0". The third `else` branch was unreachable, making the `*handled_output = NULL;` assignment dead code.
This commit is contained in:
@@ -701,7 +701,7 @@ static inline void php_url_scanner_session_handler_impl(char *output, size_t out
|
||||
len = UINT_MAX;
|
||||
}
|
||||
*handled_output_len = len;
|
||||
} else if (ZSTR_LEN(url_state->url_app.s) == 0) {
|
||||
} else {
|
||||
url_adapt_state_ex_t *ctx = url_state;
|
||||
if (ctx->buf.s && ZSTR_LEN(ctx->buf.s)) {
|
||||
smart_str_append(&ctx->result, ctx->buf.s);
|
||||
@@ -715,8 +715,6 @@ static inline void php_url_scanner_session_handler_impl(char *output, size_t out
|
||||
} else {
|
||||
*handled_output = estrndup(output, *handled_output_len = output_len);
|
||||
}
|
||||
} else {
|
||||
*handled_output = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user