diff options
author | NeilBrown <neilb@suse.de> | 2011-07-13 12:38:50 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-07-13 12:38:50 +1000 |
commit | 664d53258de31362475b43658add0ebcf95be168 (patch) | |
tree | 3aa1fcf9474cb421124b3094385e04a1e3b72159 | |
parent | 1e49aaa0696e843d5ec0ae6709558e0fe51afc06 (diff) | |
download | mdadm-664d53258de31362475b43658add0ebcf95be168.tar.gz |
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>
-rw-r--r-- | super-intel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/super-intel.c b/super-intel.c index 2ef2b3c..5ea3b36 100644 --- a/super-intel.c +++ b/super-intel.c @@ -1518,9 +1518,9 @@ 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"); + printf(" ()\n"); } close(fd); free(path); |