Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fixed a small index out of bounds error #17

Open
wants to merge 1 commit into from

2 participants

@jordanorelli

occasionally, godis would panic reading data out of redis. I prevented the panic rather inelegantly and replaced it with an error.

@simonz05
Owner

Do you know in which case does Redis return <3 characters and could it possibly be a problem somewhere else. Or can we solve this problem in a way which does not result in an error or panic. Maybe we should read some more data from redis if the reply was short (depends on the cause of the error of course).

@simonz05 simonz05 was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 10, 2012
  1. @jordanorelli
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 redis/conn.go
View
5 redis/conn.go
@@ -292,6 +292,11 @@ func (c *conn) readReply() *Reply {
return r
}
+ if len(res) < 3 {
+ r.Err = errors.New("response from redis too short")
+ return r
+ }
+
typ := res[0]
line := res[1 : len(res)-2]
Something went wrong with that request. Please try again.