-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Net coverity fixes #4818
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
Net coverity fixes #4818
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 only works because %3d has the same number of characters as, say 200 or 404. It might be a good idea to use XXX or something else here.
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.
It was done on purpose like this so that %3d is three letters wide. This way the same string can be used here and in snprintk(). Note that we only print the code if it is 100-999.
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.
Don't you also need to send a text after the numerical code? Like 200 OK or 404 Not Found? Most clients will ignore this, but not sending it isn't compliant. See RFC2616, section 6.1.
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.
There is no string to print atm as only 400 code is having a error string defined.
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.
If you think we need the error string too, then we need to fix the API (which is ok in this case as it was merged just one week ago).
It is possible to access past end of url buffer by one byte. Coverity-CID: 178790 Fixes zephyrproject-rtos#4784 Signed-off-by: Jukka Rissanen <[email protected]>
We might access null pointer in debug print. Coverity-CID: 178789 Fixes zephyrproject-rtos#4785 Signed-off-by: Jukka Rissanen <[email protected]>
If the packet is too short, the TCP header pointer might be NULL. In this case we just need to bail out. Coverity-CID: 178787 Fixes zephyrproject-rtos#4787 Signed-off-by: Jukka Rissanen <[email protected]>
|
I will send the HTTP error patch separately so that it will not block these fixes. |
|
@lpereira could you check the PR and approve if ok? |
No description provided.