super-intel: fix buffer overflow in detail-platform.
The serial number is not necessarily nul terminated, so we need to be sure to only use the allowed number of chars. Signed-off-by: NeilBrown <neilb@suse.de> Reported-by: Arvin Schnell <aschnell@novell.com>
This commit is contained in:
parent
1e49aaa069
commit
664d53258d
|
@ -1518,7 +1518,7 @@ static int ahci_enumerate_ports(const char *hba_path, int port_count, int host_b
|
|||
fd2devname(fd, buf);
|
||||
printf(" Port%d : %s", port, buf);
|
||||
if (imsm_read_serial(fd, NULL, (__u8 *) buf) == 0)
|
||||
printf(" (%s)\n", buf);
|
||||
printf(" (%.*s)\n", MAX_RAID_SERIAL_LEN, buf);
|
||||
else
|
||||
printf(" ()\n");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue