mirror of https://mirror.osredm.com/root/redis.git
Fix exprParseNumber() overflow check.
This commit is contained in:
parent
7ad3cea7fa
commit
2f1d917cf1
2
expr.c
2
expr.c
|
@ -247,7 +247,7 @@ void exprParseNumber(exprstate *es) {
|
||||||
char num[64];
|
char num[64];
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
while(isdigit(es->p[0]) || (idx == 0 && es->p[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.
|
es->syntax_error++; // Number is too long.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue