OpenPrinting / libcupsfilters

Apache License 2.0
5 stars 22 forks source link

cfCatalogLoad: fix incorrect strncpy() limit calculation #49

Closed proski closed 7 months ago

proski commented 7 months ago

Preserve the new allocated size in a variable and use it instead of sizeof().

The old calculation would wrap around in most cases, making the limit ineffective. For very short original length of human_readable (6 bytes or less on 64-bit platforms), the appended text would be cut short to fit the pointer size.

tillkamppeter commented 7 months ago

Thanks a lot, @proski and @zdohnal .