mhendriks / P1-Dongel-ESP32

P1-Dongel-ESP32
MIT License
27 stars 13 forks source link

missing boundary check in FS*.ino #14

Closed Mar10us closed 1 year ago

Mar10us commented 1 year ago

These two files have a function for listing files in the root and uses an array of 30 entries, but the while-loop does not check the index before writing to that array. This eventually results in a corrupt JSON file on the url 'api/listfiles' after uploading the 31st file.

https://github.com/mhendriks/P1-Dongel-ESP32/blob/54a6544b9719ff2534ea077b7b7d35066c468590/FSexplorer.ino#L136 https://github.com/mhendriks/P1-Dongel-ESP32/blob/54a6544b9719ff2534ea077b7b7d35066c468590/FS.ino#L28

mhendriks commented 1 year ago

Well found, Mar10us! Thanks. Adjusted in next release.