Commit 8453386
committed
wifi/esp32: Fix overflow in SSID copy
In the previous code, strnlen could have returned WIFI_SSID_MAX_LEN, and
the following statement ensuring NUL termination would have written one past
the end of the array.
Replace this with code that ensures a NUL termination within the bounds
of the array and then use strlen to compute the length.
Signed-off-by: Keith Packard <[email protected]>1 parent 9ee0bc9 commit 8453386
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
773 | | - | |
774 | | - | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
775 | 777 | | |
776 | 778 | | |
777 | 779 | | |
| |||
0 commit comments