Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr 426 #427

Merged
2 commits merged into from
May 14, 2016
Merged

Pr 426 #427

2 commits merged into from
May 14, 2016

Conversation

badboy
Copy link
Contributor

@badboy badboy commented May 14, 2016

Closes #426, now with test

paulinohuerta and others added 2 commits May 14, 2016 01:53
this issue is very significant, because not allow the proper execution of the "function redisCommandArgv". The server returns "invalid bulk length".
Thanks!
@badboy
Copy link
Contributor Author

badboy commented May 14, 2016

@not-A-robot r+

@ghost
Copy link

ghost commented May 14, 2016

📌 Commit 8655a6a has been approved by badboy

@ghost
Copy link

ghost commented May 14, 2016

⚡ Test exempted - status

@ghost ghost merged commit 8655a6a into master May 14, 2016
ghost pushed a commit that referenced this pull request May 14, 2016
Pr 426

Closes #426, now with test
@badboy badboy deleted the pr-426 branch May 14, 2016 12:52
@vstakhov
Copy link

This change looks incorrect to my opinion. According to sdscatfmt, %T modifier means size_t variable. Indeed, len has this type in hiredis.c: size_t len;. In sds.h %T is handled in the following case:

            case 'u':
            case 'U':
            case 'T':
                if (next == 'u')
                    unum = va_arg(ap,unsigned int);
                else if(next == 'U')
                    unum = va_arg(ap,unsigned long long);
                else
                    unum = (unsigned long long)va_arg(ap,size_t);

Hence, before patch, there was a correct format string. Now, on the contrary, it is broken at least on big endian machines where size_t > unsigned int and when values does not fit in unsigned int. Could you please recheck this change?

@badboy
Copy link
Contributor Author

badboy commented Jan 17, 2017

@vstakhov Uff, not sure I'm following. What values would produce an incorrect result here? (If you bring this up in a new issue referencing this PR I can better track it)

@vstakhov
Copy link

You extract size_t argument using va_arg(ap,unsigned int);. Does it look sane? The previous version did the proper thing - it extracted size_t as size_t: (unsigned long long)va_arg(ap,size_t);. I'm using this PR because it changed the correct behaviour to the incorrect one (at least, I think so).

@badboy
Copy link
Contributor Author

badboy commented Jan 17, 2017

But I can't re-open a PR to track the potential bug ;)

I take a look at this problem next week. Thanks for bringing it up.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants