OpenPrinting / cups-filters

filters, backends, driverless utility, ... - Everything which CUPS 2.x needs to be used on non-Mac systems
Apache License 2.0
159 stars 126 forks source link

DIVISION_BY_ZERO in ../cupsfilters/image-zoom.c #550

Open ellena13 opened 1 year ago

ellena13 commented 1 year ago

https://github.com/OpenPrinting/cups-filters/blob/8ac453d0c22a87984127f4c89bd5747d1409db23/cupsfilters/image-zoom.c#L127-L128

and

https://github.com/OpenPrinting/cups-filters/blob/8ac453d0c22a87984127f4c89bd5747d1409db23/cupsfilters/image-zoom.c#L154-L155

may have a zero value when variable xsize has value 0.

Check at image-zoom.c:109 does not prevent this error :

https://github.com/OpenPrinting/cups-filters/blob/8ac453d0c22a87984127f4c89bd5747d1409db23/cupsfilters/image-zoom.c#L109-L117

https://github.com/OpenPrinting/cups-filters/blob/8ac453d0c22a87984127f4c89bd5747d1409db23/cupsfilters/image-zoom.c#L130-L131

and

https://github.com/OpenPrinting/cups-filters/blob/8ac453d0c22a87984127f4c89bd5747d1409db23/cupsfilters/image-zoom.c#L157-L158

may have a zero value when variable ysize has value 0.

Check at image-zoom.c:95 does not prevent this error:

https://github.com/OpenPrinting/cups-filters/blob/8ac453d0c22a87984127f4c89bd5747d1409db23/cupsfilters/image-zoom.c#L94-L99

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.

Author E. Bykhanova.

zdohnal commented 1 year ago

Please run your scanner on the latest cups-filters version - 2.0.0, thank you!