head 1.1; access; symbols pkgsrc-2026Q2:1.1.0.12 pkgsrc-2026Q2-base:1.1 pkgsrc-2026Q1:1.1.0.10 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.8 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.6 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.4 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.2 pkgsrc-2025Q1-base:1.1; locks; strict; comment @# @; 1.1 date 2025.02.17.22.00.48; author nia; state Exp; branches; next ; commitid 5LgZhs3o92AF3SJF; desc @@ 1.1 log @libcaca: Update to 0.99.20 Special notes: - building without imlib2 is broken upstream, remove the option. - upstream switched to github. - verified to build on freebsd, netbsd, linux, macos by drecklypkg CI. Upstream changes: - IPv6 support in cacaserver - fixed a bug from 2004 that caused PDF documentation generation to fail - memory allocation functions are now more robust - numerous fixes for memory leaks and invalid memory accesses: CVE-2021-30498 CVE-2021-30499 CVE-2021-3410 CVE-2018-20546 CVE-2018-20547 CVE-2018-20545 CVE-2018-20548 CVE-2018-20549 @ text @$NetBSD$ [PATCH] Prevent a divide-by-zero by checking for a zero width or height. https://github.com/cacalabs/libcaca/pull/66 --- src/img2txt.c.orig 2018-05-22 14:04:36.000000000 +0000 +++ src/img2txt.c @@@@ -177,7 +177,13 @@@@ int main(int argc, char **argv) } /* Assume a 6×10 font */ - if(!cols && !lines) + if(!i->w || !i->h) + { + fprintf(stderr, "%s: image size is 0\n", argv[0]); + lines = 0; + cols = 0; + } + else if(!cols && !lines) { cols = 60; lines = cols * i->h * font_width / i->w / font_height; @@@@ -214,7 +220,7 @@@@ int main(int argc, char **argv) export = caca_export_canvas_to_memory(cv, format?format:"ansi", &len); if(!export) { - fprintf(stderr, "%s: Can't export to format '%s'\n", argv[0], format); + fprintf(stderr, "%s: Can't export to format '%s'\n", argv[0], format?format:"ansi"); } else { @