qmic/tests
Alex Elder 789c4e9d23 parser: avoid token buffer overflow
Define TOKEN_BUF_SIZE as the size of the buffer used when parsing
tokens.  Define TOKEN_BUF_MIN as the minimum size of the token
buffer; the size comes from what's necessary to represent a maximal
64-bit octal value.

Add checks in yylex() to avoid exhausting the token buffer on
pathological input.  Use the minimum buffer size to NUL-terminate
the buffer for a message if the token name is too long.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-28-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:35:07 -05:00
..
bad_decimal.qmi parser: be more restrictive when parsing numbers 2021-10-04 12:32:01 -05:00
bad_hex.qmi parser: be more restrictive when parsing numbers 2021-10-04 12:32:01 -05:00
bad_octal.qmi parser: be more restrictive when parsing numbers 2021-10-04 12:32:01 -05:00
bad_X.qmi parser: be more restrictive when parsing numbers 2021-10-04 12:32:01 -05:00
comments.qmi parser: add support for comments 2021-10-04 12:28:05 -05:00
duplicate_const.qmi parser: disallow duplicate members 2021-10-04 12:34:46 -05:00
duplicate_message_name.qmi parser: disallow duplicate members 2021-10-04 12:34:46 -05:00
duplicate_message_val.qmi parser: disallow duplicate members 2021-10-04 12:34:46 -05:00
duplicate_struct_name.qmi parser: disallow duplicate members 2021-10-04 12:34:46 -05:00
fixed.qmi parser: reset fixed flag each for each array 2021-10-04 12:28:56 -05:00
hexdigits.qmi parser: properly support hexadecimal numbers 2021-10-04 12:30:21 -05:00
no_package.qmi parser: introduce qmi_package_parse() 2021-10-04 12:32:25 -05:00
num_large.qmi parser: properly support 64-bit numbers 2021-10-04 12:29:38 -05:00
num_too_big.qmi parser: properly support 64-bit numbers 2021-10-04 12:29:38 -05:00
two_packages.qmi parser: introduce qmi_package_parse() 2021-10-04 12:32:25 -05:00
very_long_token.qmi parser: avoid token buffer overflow 2021-10-04 12:35:07 -05:00