Fix handle_dot_label heap-out-of-bound (#243)

This commit is contained in:
dataisland 2023-09-22 00:21:10 -05:00 committed by GitHub
parent 84be2ee6c3
commit ecb47f1c87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,7 +79,7 @@ handle_dot_label(YYSTYPE *lvalp, char *tok, size_t toklen, size_t zeropos,
lvalp->str_val = yasm__xstrndup(tok+zeropos+(parser_nasm->tasm?2:0),
toklen-zeropos-(parser_nasm->tasm?2:0));
/* check for special non-local ..@label */
if (lvalp->str_val[zeropos+2] == '@')
if (lvalp->str_val[2] == '@')
return NONLOCAL_ID;
return SPECIAL_ID;
}