diff --git a/src/WiFiStorage.h b/src/WiFiStorage.h index 54f744a0..fdccfc41 100644 --- a/src/WiFiStorage.h +++ b/src/WiFiStorage.h @@ -59,6 +59,13 @@ class WiFiStorageClass return true; } static bool downloadOTA(const char * url, uint8_t * res_ota_download = NULL) { + /* The buffer within the nina firmware allows a maximum + * url size of 128 bytes. It's better to prevent the + * transmission of over-sized URL as soon as possible. + */ + if (strlen(url) > 128) + return false; + uint8_t const res = WiFiDrv::downloadOTA(url, strlen(url)); if (res_ota_download) *res_ota_download = res;