diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-19 20:53:42 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-19 20:53:42 +0100 |
commit | 5d09c6fb3d8a413d8ead10ada657f6e459523216 (patch) | |
tree | bfb24490ed5244a97a9a1620363e86e5c042f3bd /contrib | |
parent | 2abae809e489587cfe319f92a21d7895492c4618 (diff) | |
download | rspamd-5d09c6fb3d8a413d8ead10ada657f6e459523216.tar.gz rspamd-5d09c6fb3d8a413d8ead10ada657f6e459523216.zip |
[Fix] Fix clen length for hiredis...
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/hiredis/async.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/hiredis/async.c b/contrib/hiredis/async.c index 4a2cadf8b..afa541304 100644 --- a/contrib/hiredis/async.c +++ b/contrib/hiredis/async.c @@ -611,7 +611,7 @@ static int __redisAsyncCommand(redisAsyncContext *ac, redisCallbackFn *fn, void cstr += pvariant; clen -= pvariant; - if (hasnext && clen >= 11 && strncasecmp(cstr,"subscribe\r\n",11) == 0) { + if (hasnext && clen >= 9 && strncasecmp(cstr,"subscribe\r\n",9) == 0) { c->flags |= REDIS_SUBSCRIBED; /* Add every channel/pattern to the list of subscription callbacks. */ @@ -624,7 +624,7 @@ static int __redisAsyncCommand(redisAsyncContext *ac, redisCallbackFn *fn, void if (ret == 0) sdsfree(sname); } - } else if (clen >= 13 && strncasecmp(cstr,"unsubscribe\r\n",13) == 0) { + } else if (clen >= 11 && strncasecmp(cstr,"unsubscribe\r\n",11) == 0) { /* It is only useful to call (P)UNSUBSCRIBE when the context is * subscribed to one or more channels or patterns. */ if (!(c->flags & REDIS_SUBSCRIBED)) return REDIS_ERR; @@ -632,7 +632,7 @@ static int __redisAsyncCommand(redisAsyncContext *ac, redisCallbackFn *fn, void /* (P)UNSUBSCRIBE does not have its own response: every channel or * pattern that is unsubscribed will receive a message. This means we * should not append a callback function for this command. */ - } else if(clen >= 9 && strncasecmp(cstr,"monitor\r\n",9) == 0) { + } else if(clen >= 7 && strncasecmp(cstr,"monitor\r\n",7) == 0) { /* Set monitor flag and push callback */ c->flags |= REDIS_MONITORING; __redisPushCallback(&ac->replies,&cb); |