| #
a213399f |
| 18-Jun-2025 |
Mingjie Shen <[email protected]> |
Use snprintf instead of sprintf to prevent buffer overruns
In bitops.h, update the TABLE macro to call snprintf(buf, sizeof(buf), ...) rather than unbounded sprintf, ensuring that out-of-range indic
Use snprintf instead of sprintf to prevent buffer overruns
In bitops.h, update the TABLE macro to call snprintf(buf, sizeof(buf), ...) rather than unbounded sprintf, ensuring that out-of-range indices produce a bounded "??%d" string.
In setpci.c, change the device slot formatting from sprintf(slot, ...) to snprintf(slot, sizeof(slot), ...), capping output to the 16-byte buffer and avoiding overflow when printing PCI domain, bus, dev, and func values.
Signed-off-by: Mingjie Shen <[email protected]>
show more ...
|