mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02: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:
parent
3b45b9d74e
commit
b068ee307f
1 changed files with 1 additions and 3 deletions
|
@ -701,7 +701,7 @@ static inline void php_url_scanner_session_handler_impl(char *output, size_t out
|
||||||
len = UINT_MAX;
|
len = UINT_MAX;
|
||||||
}
|
}
|
||||||
*handled_output_len = len;
|
*handled_output_len = len;
|
||||||
} else if (ZSTR_LEN(url_state->url_app.s) == 0) {
|
} else {
|
||||||
url_adapt_state_ex_t *ctx = url_state;
|
url_adapt_state_ex_t *ctx = url_state;
|
||||||
if (ctx->buf.s && ZSTR_LEN(ctx->buf.s)) {
|
if (ctx->buf.s && ZSTR_LEN(ctx->buf.s)) {
|
||||||
smart_str_append(&ctx->result, 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 {
|
} else {
|
||||||
*handled_output = estrndup(output, *handled_output_len = output_len);
|
*handled_output = estrndup(output, *handled_output_len = output_len);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
*handled_output = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue