Commit de83c8a0 authored by Vitaly Arbuzov's avatar Vitaly Arbuzov
Browse files

Use long long version of strto when parsing cursor

parent 1cf48a34
...@@ -960,10 +960,10 @@ void scanCallback(void *privdata, const dictEntry *de) { ...@@ -960,10 +960,10 @@ void scanCallback(void *privdata, const dictEntry *de) {
int parseScanCursorOrReply(client *c, robj *o, unsigned long long *cursor) { int parseScanCursorOrReply(client *c, robj *o, unsigned long long *cursor) {
char *eptr; char *eptr;
/* Use strtoul() because we need an *unsigned* long, so /* Use strtouq() because we need an *unsigned* long long, so
* getLongLongFromObject() does not cover the whole cursor space. */ * getLongLongFromObject() does not cover the whole cursor space. */
errno = 0; errno = 0;
*cursor = strtoul(o->ptr, &eptr, 10); *cursor = strtouq(o->ptr, &eptr, 10);
if (isspace(((char*)o->ptr)[0]) || eptr[0] != '\0' || errno == ERANGE) if (isspace(((char*)o->ptr)[0]) || eptr[0] != '\0' || errno == ERANGE)
{ {
addReplyError(c, "invalid cursor"); addReplyError(c, "invalid cursor");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment