adafruit / Adafruit_IO_Arduino

Arduino library to access Adafruit IO from WiFi, cellular, and ethernet modules.
Other
208 stars 108 forks source link

Buffer overrun on large data in feed save? #147

Open pete-thompson opened 3 years ago

pete-thompson commented 3 years ago

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.

brentru commented 3 years ago

, but with very odd values for lat/long (I don't set values so would expect 0,0).

Do these odd values for lat/long show up on the feed's feed page on io.adafruit.com?

pete-thompson commented 3 years ago

Yes, the values show in the feed. I can't find the specific values just now, but they were huge numbers that clearly weren't valid.

brentru commented 3 years ago

Could you file an issue at io.adafruit.com/support so we can take a look? Please include the name of the feed where this appeared.