mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
SpiffsFS.create_file() rejected names only when strictly longer than obj_name_len, but CONFIG_SPIFFS_OBJ_NAME_LEN's documented semantics (see components/spiffs/Kconfig) are that the length includes the zero-termination character, so the maximum number of actual name characters is obj_name_len - 1. With the old check, a name exactly obj_name_len characters long was accepted. SpiffsObjIndexPage.to_binary() then computes the NUL padding after the name as (obj_name_len - len(name)), which is 0 in that case, so the generated image's fixed-size name field ends up with no NUL terminator anywhere in its reserved region. Fix the boundary so the generator enforces the same maximum length that the Kconfig help text documents.