-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP crashes when a UDP packet is sent to port used by ArduinoOTA #3912
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
Comments
Although I do not know how |
Another packet to trigger a crash is:
The stacktrace appears to be:
I say "appears to be" because the logic in |
#4086 has fixes for both bad packets. |
Awesome. I will try it as soon as I can. Thank you! |
Already merged after review. Please report if it fixes your issue. |
Ok so good news and bad news. While the changes @yoursunny made did stop the ESP from crashing, it seems that they also broke OTA as I get [ERROR]: No Answer when trying to upload via OTA using the example sketch. I upgraded from 2.4.0-rc2 to 2.4.0 before applying the changes to ArduinoOTA.cpp. If I roll back the changes to ArduinoOTA.cpp, uploads via OTA again work but the crash condition also still occurs. |
Had a bit more time to play around with it this morning. If I keep the changes @yoursunny made to readStringUntil() but roll back the changes made to parseInt() everything is good. No more crash and OTA updates are working with the example sketch. Sorry, I'm kinda new to all of this. Should I send a new pull request, or should @yoursunny resubmit? |
If you rollback
Please try changing both |
That did it! No crash and OTA updates are working. PR #4092 submitted. |
* ArduinoOTA: handle end of packet in readStringUntil fixes esp8266#3912 * ArduinoOTA: fix buffer overflow in parseInt fixes esp8266#3912
Basic Infos
Hardware
Hardware: ESP-12
Core Version: 2.4.0-rc2
Description
ESP will crash and reboot when ArduinoOTA is enabled and a udp packet of any size is sent to the port used by ArduinoOTA. In fact, even just a nmap scan of the port will cause a crash (ex: nmap -sU -p 8266 192.168.1.212)
Settings in IDE
Module: WeMos D1 R2 and mini
Flash Size: 4M (3M SPIFFS)
CPU Frequency: 80Mhz
Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: