Skip to content

Commit

Permalink
Fix Accept-Language decoding (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
vlvkobal authored Feb 7, 2025
1 parent 8e4e00e commit 485b0c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wireshark/source/packet-ja4.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,16 @@ conn_info_t *conn_lookup (char proto, int stream) {
void decode_http_lang(wmem_strbuf_t **out, const char *val) {
char lang[5] = "0000";
int len = 0;

for (int i=0; i<5; i++) {
if ((val[i] == ',') || (val[i] == ';') || (len == 4)) {
if ((val[i] == ',') || (val[i] == ';') || (len == 4) || (val[i] == '\0')) {
break;
}
if ((!g_ascii_isspace(val[i])) && (val[i] != '-')) {
lang[len++] = g_ascii_tolower(val[i]);
}
}

wmem_strbuf_append_printf(*out, "%s", lang);
}

Expand Down

0 comments on commit 485b0c6

Please sign in to comment.