-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
drivers/wifi/esp_at: Fix system crash caused by null pointer #81806
Conversation
@hongquan-prog would you mind rebasing this PR? |
OK |
@hongquan-prog Ci is failing for other reason, but one is related to esp.c stuff. L870: int data_offset;
long data_len; Please, initialize the variables as in below. int data_offset = 0;
long data_len = 0; |
👌 |
e69679a
@sylvioalves I've rebased it, so if there's a new update at the time of the merge, it may need to be rebased by the person who merged it. |
drivers/wifi/esp_at/esp.c
Outdated
struct esp_socket *sock = NULL; | ||
int data_offset = 0; | ||
long data_len = 0; | ||
int err = 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.
No need to initialize the err variable as value to it is set few lines below.
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.
👌,sorry, I'm used to giving initial values to all variables, so do I need to change this place?
drivers/wifi/esp_at/esp.c
Outdated
int data_offset = 0; | ||
long data_len = 0; | ||
int err = 0; | ||
int ret = 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.
Also initializing ret
is not needed (because you set a value to it later in the function).
ff0f7c0
The code for checking the null pointer is incorrect, with ESP_AT_CIPDINFO_USE turned on, after a soft reboot of the host and before a reboot of ESP32, the host may receive an incorrect IPD message causing a system crash. Fixes zephyrproject-rtos#81804 Signed-off-by: Hongquan Li <hongquan.prog@gmail.com>
Setting initial values for uninitialised variables. Signed-off-by: Hongquan Li <hongquan.prog@gmail.com>
@hongquan-prog did you intend to close this PR? |
The code for checking the null pointer is incorrect,
with ESP_AT_CIPDINFO_USE turned on, after a soft
reboot of the host and before a reboot of ESP32, the
host may receive an incorrect IPD message causing
a system crash.
Fixes #81804