QMI IDL compiler
Go to file
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
tests parser: avoid token buffer overflow 2021-10-04 12:35:07 -05:00
.gitignore qmic: Add .gitignore 2016-06-02 10:27:42 -07:00
accessor.c kernel: Introduce kernel-style generator 2018-01-31 13:00:02 -08:00
kernel.c kernel: Support having strings in structs 2018-06-29 14:12:50 -07:00
LICENSE qmic: Add the missing LICENSE file 2016-06-02 10:26:43 -07:00
list.h qmic: Adopt common list implementation 2018-01-30 15:55:49 -08:00
Makefile Makefile: Allow compiler/linker flags to be overridden 2018-03-05 21:54:21 -08:00
parser.c parser: avoid token buffer overflow 2021-10-04 12:35:07 -05:00
qmi_tlv.c qmic: Initial basic implementation 2016-02-07 09:27:50 -08:00
qmic.c parser: properly support 64-bit numbers 2021-10-04 12:29:38 -05:00
qmic.h parser: properly support 64-bit numbers 2021-10-04 12:29:38 -05:00