| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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.
| Back | FazBrowse Home | New Git URL |
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.