@@ -33,7 +33,7 @@ void system_info_set_interface_address(unsigned int hwaddr_size,
{
struct interface_info *if_info;
unsigned int i;
- char mac[20];
+ char mac[32]; /* at least 24B for IB GUID */
for (i = 0; i < sysinfo->n_interfaces; i++) {
if_info = sysinfo->interfaces[i];
@@ -209,7 +209,7 @@ static int screen_process_form(struct config_screen *screen)
struct config *config;
int i, n_boot_opts, rc;
unsigned int *order, idx;
- char mac[20];
+ char mac[32]; /* at least 24B for IB GUID */
config = config_copy(screen, screen->cui->config);
@@ -812,7 +812,7 @@ static int find_autoboot_idx(const struct system_info *sysinfo,
for (i = 0; i < sysinfo->n_interfaces; i++) {
struct interface_info *info = sysinfo->interfaces[i];
- char mac[20];
+ char mac[32]; /* at least 24B for IB GUID */
mac_str(info->hwaddr, info->hwaddr_size, mac, sizeof(mac));
@@ -894,7 +894,7 @@ static void config_screen_setup_widgets(struct config_screen *screen,
for (i = 0; i < sysinfo->n_interfaces; i++) {
struct interface_info *info = sysinfo->interfaces[i];
- char mac[20];
+ char mac[32]; /* at least 24B for IB GUID */
mac_str(info->hwaddr, info->hwaddr_size, mac, sizeof(mac));
@@ -986,7 +986,7 @@ static void config_screen_setup_widgets(struct config_screen *screen,
for (i = 0; i < sysinfo->n_interfaces; i++) {
struct interface_info *info = sysinfo->interfaces[i];
- char str[50], mac[20];
+ char str[50], mac[32]; /* at least 24B for IB GUID */
bool is_default;
is_default = ifcfg && !hwaddr_cmp(ifcfg->hwaddr, ifcfg->hwaddr_len, info->hwaddr,
@@ -249,7 +249,7 @@ struct pmenu_item *pmenu_find_device(struct pmenu *menu, struct device *dev,
struct blockdev_info *bd;
struct cui_opt_data *cod;
struct system_info *sys;
- char hwaddr[32];
+ char hwaddr[32]; /* at least 24B for IB GUID */
unsigned int i;
char buf[256];
@@ -51,7 +51,7 @@ static void if_info_mac_str(struct interface_info *info,
static void sysinfo_screen_populate(struct sysinfo_screen *screen,
const struct system_info *sysinfo)
{
- char macbuf[32];
+ char macbuf[32]; /* at least 24B for IB GUID */
unsigned int i;
text_screen_clear(&screen->text_scr);
This makes the buffers used to generate pretty-printed hardware addresses a consistent length which is long enough to hold an Infiniband GUID. It also serves as a reference point for future cleanup so this can be reduced to a single definition. Signed-off-by: Daniel M. Weeks <weeksd2@rpi.edu> --- discover/sysinfo.c | 2 +- ui/ncurses/nc-config.c | 8 ++++---- ui/ncurses/nc-menu.c | 2 +- ui/ncurses/nc-sysinfo.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)