adafruit / adafruit/Adafruit_IO_Arduino
Buffer overrun on large data in feed save?
- Dominant language
- C++
- Stars
- 222
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Description
- Arduino board: ESP32
- Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.13
- List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too):
My sketch is rebooting frequently. The most recent thing that I've changed is to write long debug messages into an Adafruit IO feed. It appears that the messages are arriving in my feed, but with very odd values for lat/long (I don't set values so would expect 0,0). I read through the code in AdafruitIO_Data.cpp and see that it's using strcpy to copy the incoming data to the buffer without any checks for buffer overrun - so I'm guessing that if I send something longer than 45 characters I'm causing random issues that sometimes result in invalid pointer dereferences and reboots.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in AdafruitIO_Data.cpp, where incoming feed data is copied into the buffer with strcpy. Reproduce the issue on an ESP32 using a debug message longer than 45 characters and observe whether the feed values or board stability are affected. Done means long data no longer causes corrupted values, invalid pointer dereferences, or reboots.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100