-
Notifications
You must be signed in to change notification settings - Fork 163
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
Handle malloc failure in dns setcallback #1155
Handle malloc failure in dns setcallback #1155
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks good, however there are some places where the strcpy is not doing a size check and as the source pointers are coming from application there is a potential schenario where out of buffer copy can happen. Please check if we can create a new PR for the same.
{ | ||
BaseType_t xReturn = pdPASS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can the strcpy in line 158 cause a copy overflow. We can use strncpy instead or put a size check as the destination is a fixed array
Description
This PR handles malloc failure while allocating memory for DNS callback in
vDNSSetCallBack
API.Test Steps
Checklist:
Related Issue
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.