analyzer/http: Do not assume char is signed

On aarch64, char is unsigned, so is_HTTP_token_char() allowed
non-ASCII stuff with the high-bit set.

Fixes part of #2742
This commit is contained in:
Arne Welzel 2023-02-01 18:22:13 +01:00
parent e762efc9af
commit 71bcd15d2e

View file

@ -1186,9 +1186,9 @@ const char* HTTP_Analyzer::PrefixWordMatch(const char* line, const char* end_of_
return line;
}
static bool is_HTTP_token_char(char c)
static bool is_HTTP_token_char(unsigned char c)
{
return c > 31 && c != 127 && // CTL per RFC 2616.
return c > 31 && c < 127 && // Exclude non-ascii and DEL/CTL per RFC 2616
c != ' ' && c != '\t' && // Separators.
c != '(' && c != ')' && c != '<' && c != '>' && c != '@' && c != ',' && c != ';' &&
c != ':' && c != '\\' && c != '"' && c != '/' && c != '[' && c != ']' && c != '?' &&