The alphanum is not NULL-terminated, so strspn performs access to stack out of the array.
Signed-off-by: Slava Barinov <[email protected]> --- src/parse-gram.y | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/parse-gram.y b/src/parse-gram.y index 5a0b2006..993daea6 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -780,11 +780,12 @@ translate_code_braceless (char *code, location loc) static void add_param (param_type type, char *decl, location loc) { - static char const alphanum[26 + 26 + 1 + 10] = + static char const alphanum[26 + 26 + 1 + 10 + 1] = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "_" - "0123456789"; + "0123456789" + "\0"; char const *name_start = NULL; { -- 2.13.3
