Skip to content

fix srandmemberWithCountCommand bug in t_set.c #777

wants to merge 2 commits into from

3 participants


in 475 line, retval is not initialized.. because of it.

if encoding is not match below if cases.

it can pass redisAssert statement. it can be initialized as DICT_OK.

antirez commented Nov 19, 2012

Hi @charsyam, I think that while the code can be improved, initializing the variable is not the right solution.

What I mean is that, currently, setTypeNext() can only return one of the three encodings covered, so if we want to embrace defensive programming I would patch it adding an:

else {
    redisPanic("unexpected encoding in returned by setTypeNext()");

Yes, I totally agree with you. so I applied your opinion. I changed my patch according to your opinion.

@JackieXie168 JackieXie168 pushed a commit that referenced this pull request Sep 16, 2014
@mlucy mlucy changed `send` to `write` (c.f. Issue #777) e92e5fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.