util/token.h: fix possible out-of-bounds read

The 'WHITESPACE' case of the _calc_len method wrongly accessed the
character before checking upper bound of the token. The problem is fixed
by switching the order of both conditions.

Fixes #3756
This commit is contained in:
Norman Feske
2020-05-07 21:23:07 +02:00
parent 894c7411e7
commit 48b2456845
11 changed files with 122 additions and 4 deletions

View File

@@ -723,6 +723,7 @@ set default_test_pkgs {
test-terminal_crosslink
test-timer
test-tls
test-token
test-trace
test-trace_logger
test-utf8