On 27/09/2025 19:59, Osama Abdelkader wrote:
Replace all sprintf calls with snprintf to prevent potential buffer overflows
when formatting /proc paths with variable PID values.

In the context of your first change, it shows filename is defined as

  char filename[sizeof("/proc/%u/smaps") + sizeof(int)*3];

to ensure that the buffer is always large enough. The same looks true for the others as well.

If you want to change busybox to account for the possibility that the buffer size calculation is wrong anywhere, then please keep in mind that operating on a truncated file name, as your patch would make it do, would be doing the wrong thing.

Cheers,
Harald van Dijk
_______________________________________________
busybox mailing list
[email protected]
https://lists.busybox.net/mailman/listinfo/busybox

Reply via email to