Fix filename buffer overflow in create_filename
FILE_NAME is a fixed 48-byte buffer, but the loop copying the filename parsed from the download URL had no length check, so a filename longer than 48 characters would overflow into adjacent variables (FILE_INI, DIR_zifi, DIR_download, DIR_date). Bound the copy loop to 48 bytes. Verified on hardware via a temporary diagnostic test (since removed): folder/file creation with long names and write+read-back through the FAT32 driver both work correctly, and downloads/<date> is confirmed write-only (playback/viewing always reads from memory, never disk). Documented the fix in README.md.
This commit is contained in:
Binary file not shown.
Reference in New Issue
Block a user