From 74475a5f18ef724933d1aa6027b2be6cd58f8cf4 Mon Sep 17 00:00:00 2001 From: Debian NVIDIA Maintainers Date: Thu, 12 Jun 2025 01:43:03 +0200 Subject: [PATCH] fix pcie id string overrun Origin: commit:44cd9bd71fb4ded05be51f0d653b59a043b31088 Applied-Upstream: commit:44cd9bd71fb4ded05be51f0d653b59a043b31088 Bug-Debian: https://bugs.debian.org/979006 Gbp-Pq: Name pcie_id_overrun.patch --- src/bbsecondary.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bbsecondary.c b/src/bbsecondary.c index 14d5104..11520b8 100644 --- a/src/bbsecondary.c +++ b/src/bbsecondary.c @@ -139,9 +139,10 @@ bool start_secondary(bool need_secondary) { return true; //no problems, start X if not started yet if (!bb_is_running(bb_status.x_pid)) { - char pci_id[12]; + char pci_id[13]; static char *x_conf_file; - snprintf(pci_id, 12, "PCI:%02d:%02d:%o", pci_bus_id_discrete->bus, + // 0-255 bus, 0-31 slot, 0-7 func + snprintf(pci_id, 13, "PCI:%03d:%02d:%o", pci_bus_id_discrete->bus, pci_bus_id_discrete->slot, pci_bus_id_discrete->func); if (!x_conf_file) { x_conf_file = xorg_path_w_driver(bb_config.x_conf_file, bb_config.driver); -- 2.30.2