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 crash when using skipdata with NULL mnemonic #1703

Merged
merged 1 commit into from
Mar 19, 2021

Conversation

zydeco
Copy link
Contributor

@zydeco zydeco commented Nov 15, 2020

When setting up skipdata with the mnemonic as NULL, capstone will crash during disassembly here when trying to strcpy a null pointer:
https://github.com/aquynh/capstone/blob/c93fa3a79614a0de48dcb0b9dd98156bd6326bee/cs.c#L945-L946

This can be verified by changing cs_opt_skipdata in test_skipdata.c.

This fix will use the SKIPDATA_MNEM constant when NULL is passed, so it will work according to the documentation:
https://github.com/aquynh/capstone/blob/c93fa3a79614a0de48dcb0b9dd98156bd6326bee/include/capstone/capstone.h#L255-L260

@pranith
Copy link
Contributor

pranith commented Mar 4, 2021

Can you please create a new PR on libcapstone?

@aquynh aquynh merged commit 27ac4c0 into capstone-engine:next Mar 19, 2021
@aquynh
Copy link
Collaborator

aquynh commented Mar 19, 2021

merged, thanks!

@riptl riptl mentioned this pull request Jul 22, 2022
6 tasks
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.

None yet

3 participants