Commit 422bd453 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Fix parser for integer == 0

parent 572a9674
......@@ -30,6 +30,7 @@
X(integer_start) \
X(integer_19) \
X(integer_09) \
X(integer_cr) \
X(integer_lf) \
X(bulk) \
X(bulk_cr) \
......@@ -199,6 +200,11 @@ size_t redis_parser_execute(redis_parser_t *parser, redis_protocol_t **dst, cons
TRANSITION(integer_09);
}
/* Consume single zero character */
if (ch == '0') {
TRANSITION(integer_cr);
}
goto error;
}
......@@ -231,6 +237,16 @@ size_t redis_parser_execute(redis_parser_t *parser, redis_protocol_t **dst, cons
goto error;
}
case s_integer_cr:
l_integer_cr:
{
if (ch == '\r') {
TRANSITION(integer_lf);
}
goto error;
}
case s_integer_lf:
l_integer_lf:
{
......
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