Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/t_zset.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,12 @@ static int zslParseRange(robj *min, robj *max, zrangespec *spec) {
char *s = objectGetVal(min);
size_t len = sdslen(s);
if (s[0] == '(') {
if (len < 2) return C_ERR; /* bare "(" with no number */
spec->min = valkey_strtod_n(s + 1, len - 1, &eptr);
if (eptr[0] != '\0' || isnan(spec->min)) return C_ERR;
spec->minex = 1;
} else {
if (len == 0) return C_ERR; /* empty string */
spec->min = valkey_strtod_n(s, len, &eptr);
if (eptr[0] != '\0' || isnan(spec->min)) return C_ERR;
}
Expand All @@ -648,10 +650,12 @@ static int zslParseRange(robj *min, robj *max, zrangespec *spec) {
char *s = objectGetVal(max);
size_t len = sdslen(s);
if (s[0] == '(') {
if (len < 2) return C_ERR; /* bare "(" with no number */
spec->max = valkey_strtod_n(s + 1, len - 1, &eptr);
if (eptr[0] != '\0' || isnan(spec->max)) return C_ERR;
spec->maxex = 1;
} else {
if (len == 0) return C_ERR; /* empty string */
spec->max = valkey_strtod_n(s, len, &eptr);
if (eptr[0] != '\0' || isnan(spec->max)) return C_ERR;
}
Expand Down
Loading