enhanced the radix check in the feed handler
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-24 22:24:31 +09:00
parent 568166b4e2
commit 2595e5b35d
3 changed files with 30 additions and 10 deletions

View File

@ -3124,10 +3124,10 @@ static int flx_plain_number (hcl_t* hcl, hcl_ooci_t c) /* number */
if (!pn->fpdec && pn->tok_type == HCL_TOK_NUMLIT && pn->digit_count[0] > 0 && c == 'r')
{
/* 16rABCD */
if (pn->radix_cand_overflown)
if (pn->radix_cand_overflown || pn->radix_cand < 2 || pn->radix_cand > 36)
{
hcl_setsynerrbfmt (hcl, HCL_SYNERR_NUMLIT, TOKEN_LOC(hcl), HCL_NULL,
"radix too large '%.*js' before '%jc'",
"unsupported radix '%.*js' before '%jc'",
TOKEN_NAME_LEN(hcl), TOKEN_NAME_PTR(hcl), c);
return -1;
}