antirez/hiredis — Issue #85: Failure during partial response handling
Author: mangobrain
Created: 2012-02-17 11:06:50+00:00
State: open

If redisReaderFeed() is called with a buffer which does not contain a full response, e.g. just ":" (the first byte of an integer response), then a subsequent call to redisReaderGetReply() appears to do a destructive read on the data when checking the response type (the call to readBytes inside processItem). Calling redisReaderFeed() again, supplying the remainder of the response, results in an error from redisReaderGetReply() instead of parsing the now-complete response.

In our case, we are using non-blocking I/O, but this could be a problem in any case where buffers are not guaranteed to contain full responses, e.g. if responses are unusually large, or use of pipelining results in partial responses spanning multiple read calls.