Permalink
Browse files

fixed a segfault issue on i386.

  • Loading branch information...
agentzh committed Jul 7, 2011
1 parent a6870f4 commit 10d35825532c3218388f3c73e138ff8427bfa02a
Showing with 14 additions and 14 deletions.
  1. +14 −14 redis-parser.c
View
@@ -444,26 +444,26 @@ parse_multi_bulk_reply(lua_State *L, char **src, const char *last)
case '$':
p++;
dst = parse_bulk_reply(p, last, &dst_len);
- if (dst_len == -2) {
- dd("bulk %d reply parse fail for multi bulks", i);
- return PARSE_ERROR;
- }
-
- if (dst_len == -1) {
- lua_pushnil(L);
- p = dst + sizeof("\r\n") - 1;
-
- } else {
- lua_pushlstring(L, dst, dst_len);
- p = dst + dst_len + sizeof("\r\n") - 1;
- }
-
break;
default:
goto invalid;
}
+ if (dst_len == -2) {
+ dd("bulk %d reply parse fail for multi bulks", i);
+ return PARSE_ERROR;
+ }
+
+ if (dst_len == -1) {
+ lua_pushnil(L);
+ p = dst + sizeof("\r\n") - 1;
+
+ } else {
+ lua_pushlstring(L, dst, dst_len);
+ p = dst + dst_len + sizeof("\r\n") - 1;
+ }
+
lua_rawseti(L, -2, i);
}

0 comments on commit 10d3582

Please sign in to comment.