Skip to content

Commit 6054f43

Browse files
authored
Limit the maximum length of the download URL for the OTA binary since the receive buffer on the nina firmware can't hold more than 128 bytes (#131)
1 parent b6a6180 commit 6054f43

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/WiFiStorage.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ class WiFiStorageClass
5959
return true;
6060
}
6161
static bool downloadOTA(const char * url, uint8_t * res_ota_download = NULL) {
62+
/* The buffer within the nina firmware allows a maximum
63+
* url size of 128 bytes. It's better to prevent the
64+
* transmission of over-sized URL as soon as possible.
65+
*/
66+
if (strlen(url) > 128)
67+
return false;
68+
6269
uint8_t const res = WiFiDrv::downloadOTA(url, strlen(url));
6370
if (res_ota_download)
6471
*res_ota_download = res;

0 commit comments

Comments
 (0)