diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-10-14 14:18:50 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-10-14 14:18:50 +1100 |
commit | 3ed44fa2ccab0010252f2d212d2aab27c019ca33 (patch) | |
tree | 726c8f30ef3550be7b67046c23b78eecfa4025cd | |
parent | 7c9f2592b16cbebcc9db09c4d05ab251b9465b4f (diff) | |
download | skiboot-3ed44fa2ccab0010252f2d212d2aab27c019ca33.zip skiboot-3ed44fa2ccab0010252f2d212d2aab27c019ca33.tar.gz skiboot-3ed44fa2ccab0010252f2d212d2aab27c019ca33.tar.bz2 |
Fix strcat onto uninit string for pci location code
I don't *think* we've managed to hit this in the wild, although probably
largely by accident than anything on purpose.
Fix is to just explicitly set it to ''.
Fixes: 58ccf6a977ade80e4475d7d350c4c076ab1accad
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/pci.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1151,6 +1151,8 @@ static void pci_add_slot_properties(struct phb *phb, struct pci_slot_info *info, char loc_code[LOC_CODE_SIZE]; size_t base_loc_code_len = 0, slot_label_len = 0; + loc_code[0] = '\0'; + if (phb->base_loc_code) { base_loc_code_len = strlen(phb->base_loc_code); strcpy(loc_code, phb->base_loc_code); |