diff --git a/docs/changes.txt b/docs/changes.txt index 8cca6cdf2..efb90d599 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -20,6 +20,7 @@ ## Improvements ## +- Memory: Limit maximum host memory to allocate depending on bitness - Tests: Added hash-modes 11700 (Streebog-256) and 11800 (Streebog-512) - Tests: Added hash-mode 11850 (HMAC-Streebog-512 (key = $pass), big-endian) @@ -33,6 +34,7 @@ - Fixed ignoring --brain-client-features configuration when brain-server has attack positions information from a previous run - Fixed missing call to WSACleanup() to cleanly shutdown windows sockets system - Fixed missing call to WSAStartup() and client indexing in order to start the brain server on Windows +- Fixed checking the length of the last token in a hash if it was given the attribute TOKEN_ATTR_FIXED_LENGTH - Fixed out-of-bounds write in short-term memory of the brain-server * changes v4.2.1 -> v5.0.0 diff --git a/src/interface.c b/src/interface.c index a0a49a36f..60bdd2bd3 100644 --- a/src/interface.c +++ b/src/interface.c @@ -2556,7 +2556,16 @@ static int input_tokenizer (u8 *input_buf, int input_len, token_t *token) } } - token->len[token_idx] = len_left; + if (token->attr[token_idx] & TOKEN_ATTR_FIXED_LENGTH) + { + int len = token->len[token_idx]; + + if (len_left != len) return (PARSER_TOKEN_LENGTH); + } + else + { + token->len[token_idx] = len_left; + } // verify data