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

Fix bug with command lengths over 127 #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Will-W
Copy link

@Will-W Will-W commented Feb 4, 2015

The wrong value is being compared for the length.

It was working before because len was a large number (above 4) so never failed the check.

Command line lengths in the range 128-255 have the high bit set in the least significant byte (which is the most significant byte before the ntohl byte reversal is done). During the comparison that first bit is interpreted as a sign bit, so len is interpreted as negative and the check incorrectly fails.

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.

1 participant