From 3ed44fa2ccab0010252f2d212d2aab27c019ca33 Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Wed, 14 Oct 2015 14:18:50 +1100 Subject: 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 --- core/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/pci.c b/core/pci.c index 963d805..92ff2cf 100644 --- a/core/pci.c +++ b/core/pci.c @@ -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); -- cgit v1.1