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

Bug in gsmi_send_msg_to_producer_mbox() #12

Closed
dslc opened this issue May 31, 2019 · 2 comments
Closed

Bug in gsmi_send_msg_to_producer_mbox() #12

dslc opened this issue May 31, 2019 · 2 comments

Comments

@dslc
Copy link

dslc commented May 31, 2019

In gsmi_send_msg_to_producer_mbox() ...

If the library fails to place the message in the producer queue - and subsequently deallocates the message memory and resets the pointer as it does at
https://github.com/MaJerle/GSM_AT_Lib/blob/86929f299f7b2546af4d258f214e9629ef6322bb/src/gsm/gsm_int.c#L2114 - then it should return straight away. Otherwise it will attempt to dereference a null pointer.

Perhaps the simplest solution is to replace https://github.com/MaJerle/GSM_AT_Lib/blob/86929f299f7b2546af4d258f214e9629ef6322bb/src/gsm/gsm_int.c#L2115 with

return gsmERR;
@MaJerle
Copy link
Owner

MaJerle commented May 31, 2019

Thanks for reporting. i agree that the problem is one line lower.

https://github.com/MaJerle/GSM_AT_Lib/blob/86929f299f7b2546af4d258f214e9629ef6322bb/src/gsm/gsm_int.c#L2118

If statement should check res first, then msg.

@dslc
Copy link
Author

dslc commented Jun 1, 2019

Thanks for the response. I see you have already committed the bug fix. I will close this issue now.

@dslc dslc closed this as completed Jun 1, 2019
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

2 participants