redis/hiredis — pull request #218 by sergeyzavadski (2014-01-16 19:59:17+00:00)
Title: fixing random dynamic string issue

I wrote a proxy server that uses libevent and asynchronous hirers operation mode. I was running into a bug when for some reason output buffer in redis context was NULL. That seems to fix the issue

Here is the trace from the crash before the fix:
#0 0x000000000042caa4 in sdslen (s=0x0) at sds.h:47
#1 0x000000000042ce48 in sdscatlen (s=0x0, t=0x7ffff0000be0, len=82) at sds.c:129
#2 0x000000000042c6d3 in __redisAppendCommand (c=0x64a430,
cmd=0x7ffff0000be0 "*2\r\n$11\r\nsrandmember\r\n$53\r\n8749754495ea9121000000000125a2a0:kingdoms:development\r\n", len=82) at hiredis.c:1223
#3 0x0000000000428771 in __redisAsyncCommand (ac=0x64a430, fn=0x407f5a ,
privdata=0x7ffff0000a30, cmd=0x7ffff0000be0 "*2\r\n$11\r\nsrandmember\r\n$53\r\n8749754495ea9121000000000125a2a0:kingdoms:development\r\n", len=82)
at async.c:613
#4 0x00000000004287fa in redisvAsyncCommand (ac=0x64a430, fn=0x407f5a ,
privdata=0x7ffff0000a30, format=0x42e1d0 "srandmember %s", ap=0x7ffff645db08) at async.c:626