OpenPrinting / cups

OpenPrinting CUPS Sources
https://openprinting.github.io/cups
Apache License 2.0
958 stars 174 forks source link

locale/checkpo.c: Prevent appending "..." if bufsize is too small #921

Closed AtariDreams closed 3 months ago

AtariDreams commented 3 months ago

The problem is that we risk overrunning the buffer if we decide to copy the "..." string if we do not have enough space.

I have a bad gut feeling about this code, and upon hearing about recent events, I have decided to audit code here. I wish I had a test right now to prove it, but at the moment, I think that the safest thing to do is to be suspicious of any code that is used in memory operations.

michaelrsweet commented 3 months ago

[master 497e2527f] Use size_t for buffer size and make sure it is at least 4 bytes long (Issue #921)