FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Prevent m2sh from crashing when it's given too many arguments by cpick · Pull Request #267 · mongrel2/mongrel2 · GitHub

Prevent m2sh from crashing when it's given too many arguments - #267

Open
cpick wants to merge 3 commits into
mongrel2:masterfrom
cpick:maxtokens
Open

Prevent m2sh from crashing when it's given too many arguments#267
cpick wants to merge 3 commits into
mongrel2:masterfrom
cpick:maxtokens

Conversation

cpick commented Jul 25, 2015

Copy link
Copy Markdown

m2sh command line parsing failed to check whether it was exceeding its maximum number of tokens.

These changes fix the bug and adds tests to verify the fix.

Chris Pick added 3 commits July 25, 2015 00:55
m2sh currently crashes when it's passed too many arguments; add an illustrative
test case.
The maximum number of tokens (as opposed to the number of bytes) was used as
the length argument to a memcpy() call.

In practice this didn't turn out to be an issue since it would require more
than 13 or 25 (MAX_TOKENS / sizeof(Token *)) command line arguments to trigger,
and even then it would result in observably correct behavior since the
memcpy()'s destination was only used in Command_destroy() which would simply
leak the un-copied tokens.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL