Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37939 )
Change subject: utils/kconfig/nconf.c: Fix truncation warning in `item_add_str` ......................................................................
Patch Set 2:
(3 comments)
Hello Jude, thanks for your patch. Do you intend to upstream it to Linux? Also, I'm curious, is this fixing an actual issues or is it only about cosmetics?
https://review.coreboot.org/c/coreboot/+/37939/2/util/kconfig/nconf.c File util/kconfig/nconf.c:
https://review.coreboot.org/c/coreboot/+/37939/2/util/kconfig/nconf.c@570 PS2, Line 570: int kmi_str_len; /* length of initial string */ : int str_space; /* length of unused space in string */ These could be `size_t`.
https://review.coreboot.org/c/coreboot/+/37939/2/util/kconfig/nconf.c@577 PS2, Line 577: kmi_str_len = strlen(k_menu_items[index].str); Using strnlen() would avoid potential overflows if .str isn't properly terminated.
https://review.coreboot.org/c/coreboot/+/37939/2/util/kconfig/nconf.c@589 PS2, Line 589: k_menu_items[index].str); This is oddly indented (and I don't see how changing this makes anything better).