]> granicus.if.org Git - esp-idf/commitdiff
nvs_util: Add check for keylen in input csv
authorShivani Tipnis <shivani@espressif.com>
Fri, 28 Jun 2019 06:33:53 +0000 (12:03 +0530)
committerbot <bot@espressif.com>
Fri, 5 Jul 2019 11:06:02 +0000 (11:06 +0000)
components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py

index bc295af979cb1fc56030ae19ff4eba18a1a3bff5..ef4e51bfd6cd118a0f81e3fd2825d9f3c6c5085b 100755 (executable)
@@ -755,6 +755,8 @@ def nvs_part_gen(input_filename=None, output_filename=None, input_part_size=None
             reader = csv.DictReader(input_file, delimiter=',')
             for row in reader:
                 try:
+                    if len(row["key"]) > 15:
+                        raise InputError("Error: Length of key `%s` should be <= 15 characters." % row["key"])
                     write_entry(nvs_obj, row["key"], row["type"], row["encoding"], row["value"])
                 except (InputError) as e:
                     print(e)