Fix exprParseNumber() overflow check.

This commit is contained in:
antirez 2025-02-23 09:01:26 +01:00
parent 7ad3cea7fa
commit 2f1d917cf1
1 changed files with 1 additions and 1 deletions

2
expr.c
View File

@ -247,7 +247,7 @@ void exprParseNumber(exprstate *es) {
char num[64];
int idx = 0;
while(isdigit(es->p[0]) || (idx == 0 && es->p[0] == '-')) {
if (idx == sizeof(num)-1) {
if (idx >= sizeof(num)-1) {
es->syntax_error++; // Number is too long.
break;
}