-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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/socket/getsockopt: move the options check to the upper layer #15899
base: master
Are you sure you want to change the base?
Conversation
[Experimental Bot, please feedback here] No, this PR does not fully meet the NuttX requirements. While it provides a summary of what the change does, it lacks crucial information:
Example of an Improved Summary: "Fixes a potential crash in Example of Improved Testing: "Build Host: Linux (Ubuntu 22.04), x86_64, GCC 11.2.0 Testing logs before change:
Testing logs after change:
|
net/socket/getsockopt.c
Outdated
@@ -271,6 +264,13 @@ int psock_getsockopt(FAR struct socket *psock, int level, int option, | |||
{ | |||
int ret = -ENOPROTOOPT; | |||
|
|||
/* Verify that the socket option if valid (but might not be supported ) */ | |||
|
|||
if (!value || !value_len) |
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 (!value || !value_len) | |
if (value == NULL || value_len == 0) |
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.
done.
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.
please update the title to
net/socket/getsockopt: move the options check to the upper layer
done. |
check parameters at the top level to avoid errors when assigning values in si_getsockopt. Signed-off-by: zhanghongyu <[email protected]>
Summary
check parameters at the top level to avoid errors when assigning values in si_getsockopt.
Impact
N/A
Testing
qemu:local