mirror of
https://github.com/linux-msm/qmic.git
synced 2026-02-25 13:11:34 -08:00
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>