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

No NULL check in mgos_rpc_call_oplya() #5

Open
e3b0c442 opened this issue Jan 14, 2019 · 0 comments
Open

No NULL check in mgos_rpc_call_oplya() #5

e3b0c442 opened this issue Jan 14, 2019 · 0 comments

Comments

@e3b0c442
Copy link

e3b0c442 commented Jan 14, 2019

Hello.

There is an inconsistency in the mgos_ api versus the documented mg_ API for sending RPC messages. mg_ API docs explicitly state that the callback and callback args can be NULL for messages where no response is expected. However, in the mgos_ API does not check for NULL callbacks and therefore attempts to call a null function, causing a system crash. I have verified that adding a nop callback function in place of NULL in mgos_rpc_send() resolves the crashing issues.

This could be remedied in one of two ways based on my examination of the code:

or,

I consider the second to be preferable to avoid unnecessary heap allocation.

Please let me know if you need more information.

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

No branches or pull requests

1 participant