[rtems commit] cpukit/libpci: fix potential buffer overflow in pci_cfg_print_code.c
Vijay Kumar Banerjee
vijay at rtems.org
Wed May 26 22:45:42 UTC 2021
Module: rtems
Branch: master
Commit: e2011dca26b5efcf3ff14527af4be3d43142bd14
Changeset: http://git.rtems.org/rtems/commit/?id=e2011dca26b5efcf3ff14527af4be3d43142bd14
Author: Harrison Edward Gerber <gerberhe11 at gmail.com>
Date: Wed May 26 15:25:45 2021 -0700
cpukit/libpci: fix potential buffer overflow in pci_cfg_print_code.c
See also CID 1399721
Closes #4442
---
cpukit/libpci/pci_cfg_print_code.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpukit/libpci/pci_cfg_print_code.c b/cpukit/libpci/pci_cfg_print_code.c
index e758fa6..e0979db 100644
--- a/cpukit/libpci/pci_cfg_print_code.c
+++ b/cpukit/libpci/pci_cfg_print_code.c
@@ -65,8 +65,8 @@ static void pci_cfg_print_device(struct pci_dev *dev, char *prefix)
char name[32];
char buf[8];
printf("%s.resources = {\n", prefix);
- strcpy(buf, prefix);
- strcat(buf, "\t");
+ strlcpy(buf, prefix, sizeof(buf));
+ strlcat(buf, "\t", sizeof(buf));
pci_cfg_print_resources(dev->resources, buf);
printf("%s},\n", prefix);
if (dev->next == NULL) {
More information about the vc
mailing list