Merge branch 'contrib/github_pr_18829' into 'master'

fix(spiffs): fix off-by-one in spiffsgen.py obj name length check (GitHub PR)

Closes IDFGH-17964

See merge request espressif/esp-idf!50671
This commit is contained in:
Martin Vychodil
2026-07-17 18:51:37 +08:00
+2 -1
View File
@@ -423,7 +423,8 @@ class SpiffsFS:
return self.remaining_blocks <= 0
def create_file(self, img_path, file_path): # type: (str, str) -> None
if len(img_path) > self.build_config.obj_name_len:
# obj_name_len includes NUL (CONFIG_SPIFFS_OBJ_NAME_LEN); max chars is obj_name_len - 1.
if len(img_path) > self.build_config.obj_name_len - 1:
log.die(f"object name '{img_path}' too long")
name = img_path