Skip to content

Fix bug with command lengths over 127#11

Open
Will-W wants to merge 1 commit intoRangeNetworks:masterfrom
Will-W:master
Open

Fix bug with command lengths over 127#11
Will-W wants to merge 1 commit intoRangeNetworks:masterfrom
Will-W:master

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