]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict-redis: Don't crash when receiving invalid input instead of expected $size.
authorTimo Sirainen <tss@iki.fi>
Wed, 23 Oct 2013 12:16:52 +0000 (15:16 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 23 Oct 2013 12:16:52 +0000 (15:16 +0300)
src/lib-dict/dict-redis.c

index c0a10c203493a887562fd39d826869869e923dc7..5d71e2fc40518247b4391d6a686cbae7f06e1726 100644 (file)
@@ -137,8 +137,7 @@ static int redis_input_get(struct redis_connection *conn)
                if (line[0] != '$' || str_to_uint(line+1, &conn->bytes_left) < 0) {
                        i_error("redis: Unexpected input (wanted $size): %s",
                                line);
-                       redis_conn_destroy(&conn->conn);
-                       return 1;
+                       return -1;
                }
                conn->bytes_left += 2; /* include trailing CRLF */
        }