cacalabs / libcaca

💩 Colour ASCII Art Library
Do What The F*ck You Want To Public License
519 stars 70 forks source link

Prevent a divide-by-zero by checking for a zero width or height. #66

Open jmoellers opened 2 years ago

jmoellers commented 2 years ago

When a zero width or zero height image is given, a divide-by-zero exception will occur. This patch checks for this condition, emits a warning message and sets the lines and cols to 0 in that case. This fixes CVE-2022-0856