Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package chafa for openSUSE:Factory checked in at 2022-05-05 23:07:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/chafa (Old) and /work/SRC/openSUSE:Factory/.chafa.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "chafa" Thu May 5 23:07:01 2022 rev:13 rq:975093 version:1.10.3 Changes: -------- --- /work/SRC/openSUSE:Factory/chafa/chafa.changes 2022-04-25 23:35:36.650423475 +0200 +++ /work/SRC/openSUSE:Factory/.chafa.new.1538/chafa.changes 2022-05-05 23:07:39.661652243 +0200 @@ -1,0 +2,7 @@ +Thu May 5 08:32:33 UTC 2022 - Michael Vetter <mvet...@suse.com> + +- Update to 1.10.3: + * Improved input validation in the XWD loader. + * huntr.dev: Buffer over-read when compiled with -O0 or non-x86 target + +------------------------------------------------------------------- Old: ---- chafa-1.10.2.tar.xz New: ---- chafa-1.10.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ chafa.spec ++++++ --- /var/tmp/diff_new_pack.2PsxKl/_old 2022-05-05 23:07:40.905653796 +0200 +++ /var/tmp/diff_new_pack.2PsxKl/_new 2022-05-05 23:07:40.909653801 +0200 @@ -17,7 +17,7 @@ Name: chafa -Version: 1.10.2 +Version: 1.10.3 Release: 0 Summary: Image-to-text converter for terminal License: LGPL-3.0-or-later ++++++ chafa-1.10.2.tar.xz -> chafa-1.10.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/chafa-1.10.2/NEWS new/chafa-1.10.3/NEWS --- old/chafa-1.10.2/NEWS 2022-04-25 00:31:49.000000000 +0200 +++ new/chafa-1.10.3/NEWS 2022-05-04 02:47:42.000000000 +0200 @@ -1,6 +1,18 @@ Chafa releases ============== +1.10.3 (2022-05-04) +------------------- + +This release fixes multiple input validation issues. These were found in the +'chafa' command-line tool and do not affect the library backend. + +* Improved input validation in the XWD loader. + +* Bug fixes: + huntr.dev Buffer over-read when compiled with -O0 or non-x86 target + (reported by @JieyongMa). + 1.10.2 (2022-04-25) ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/chafa-1.10.2/configure new/chafa-1.10.3/configure --- old/chafa-1.10.2/configure 2022-04-25 00:39:23.000000000 +0200 +++ new/chafa-1.10.3/configure 2022-05-04 02:49:42.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for chafa 1.10.2. +# Generated by GNU Autoconf 2.69 for chafa 1.10.3. # # Report bugs to <h...@hpjansson.org>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='chafa' PACKAGE_TARNAME='chafa' -PACKAGE_VERSION='1.10.2' -PACKAGE_STRING='chafa 1.10.2' +PACKAGE_VERSION='1.10.3' +PACKAGE_STRING='chafa 1.10.3' PACKAGE_BUGREPORT='h...@hpjansson.org' PACKAGE_URL='' @@ -1392,7 +1392,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures chafa 1.10.2 to adapt to many kinds of systems. +\`configure' configures chafa 1.10.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1462,7 +1462,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of chafa 1.10.2:";; + short | recursive ) echo "Configuration of chafa 1.10.3:";; esac cat <<\_ACEOF @@ -1604,7 +1604,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -chafa configure 1.10.2 +chafa configure 1.10.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1973,7 +1973,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by chafa $as_me 1.10.2, which was +It was created by chafa $as_me 1.10.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2831,7 +2831,7 @@ # Define the identity of the package. PACKAGE='chafa' - VERSION='1.10.2' + VERSION='1.10.3' cat >>confdefs.h <<_ACEOF @@ -2933,8 +2933,8 @@ CHAFA_MAJOR_VERSION=1 CHAFA_MINOR_VERSION=10 -CHAFA_MICRO_VERSION=2 -CHAFA_VERSION=1.10.2 +CHAFA_MICRO_VERSION=3 +CHAFA_VERSION=1.10.3 @@ -2948,7 +2948,7 @@ $as_echo "#define CHAFA_MINOR_VERSION 10" >>confdefs.h -$as_echo "#define CHAFA_MICRO_VERSION 2" >>confdefs.h +$as_echo "#define CHAFA_MICRO_VERSION 3" >>confdefs.h cat >>confdefs.h <<_ACEOF @@ -15463,7 +15463,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by chafa $as_me 1.10.2, which was +This file was extended by chafa $as_me 1.10.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15529,7 +15529,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -chafa config.status 1.10.2 +chafa config.status 1.10.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/chafa-1.10.2/configure.ac new/chafa-1.10.3/configure.ac --- old/chafa-1.10.2/configure.ac 2022-04-25 00:32:46.000000000 +0200 +++ new/chafa-1.10.3/configure.ac 2022-05-04 02:48:29.000000000 +0200 @@ -6,7 +6,7 @@ m4_define([chafa_major_version], [1]) m4_define([chafa_minor_version], [10]) -m4_define([chafa_micro_version], [2]) +m4_define([chafa_micro_version], [3]) m4_define([chafa_version], [chafa_major_version.chafa_minor_version.chafa_micro_version]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/chafa-1.10.2/docs/chafa.1 new/chafa-1.10.3/docs/chafa.1 --- old/chafa-1.10.2/docs/chafa.1 2022-04-25 00:39:40.000000000 +0200 +++ new/chafa-1.10.3/docs/chafa.1 2022-05-04 02:50:01.000000000 +0200 @@ -2,7 +2,7 @@ .\" Title: chafa .\" Author: Hans Petter Jansson .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 04/25/2022 +.\" Date: 05/04/2022 .\" Manual: User Commands .\" Source: chafa .\" Language: English diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/chafa-1.10.2/docs/html/index.html new/chafa-1.10.3/docs/html/index.html --- old/chafa-1.10.2/docs/html/index.html 2022-04-25 00:39:53.000000000 +0200 +++ new/chafa-1.10.3/docs/html/index.html 2022-05-04 02:50:36.000000000 +0200 @@ -15,7 +15,7 @@ <div> <div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">Chafa Reference Manual</p></th></tr></table></div> <div><p class="releaseinfo"> - For Chafa version 1.10.2 + For Chafa version 1.10.3 . The latest version of this documentation can be found online at <a class="ulink" href="https://hpjansson.org/chafa/ref/index.html" target="_top">https://hpjansson.org/chafa/ref/</a>. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/chafa-1.10.2/tools/chafa/xwd-loader.c new/chafa-1.10.3/tools/chafa/xwd-loader.c --- old/chafa-1.10.2/tools/chafa/xwd-loader.c 2022-04-25 00:31:49.000000000 +0200 +++ new/chafa-1.10.3/tools/chafa/xwd-loader.c 2022-05-02 01:10:20.000000000 +0200 @@ -165,55 +165,79 @@ } #define ASSERT_HEADER(x) if (!(x)) return FALSE +#define UNPACK_FIELD_U32(dest, src, field) ((dest)->field = GUINT32_FROM_BE ((src)->field)) +#define UNPACK_FIELD_S32(dest, src, field) ((dest)->field = GINT32_FROM_BE ((src)->field)) static gboolean -load_header (XwdLoader *loader) // gconstpointer in, gsize in_max_len, XwdHeader *header_out) +load_header (XwdLoader *loader) { XwdHeader *h = &loader->header; XwdHeader in; - const guint32 *p = (const guint32 *) ∈ + const XwdHeader *inp; if (!file_mapping_taste (loader->mapping, &in, 0, sizeof (in))) return FALSE; - h->header_size = g_ntohl (*(p++)); - h->file_version = g_ntohl (*(p++)); - h->pixmap_format = g_ntohl (*(p++)); - h->pixmap_depth = g_ntohl (*(p++)); - h->pixmap_width = g_ntohl (*(p++)); - h->pixmap_height = g_ntohl (*(p++)); - h->x_offset = g_ntohl (*(p++)); - h->byte_order = g_ntohl (*(p++)); - h->bitmap_unit = g_ntohl (*(p++)); - h->bitmap_bit_order = g_ntohl (*(p++)); - h->bitmap_pad = g_ntohl (*(p++)); - h->bits_per_pixel = g_ntohl (*(p++)); - h->bytes_per_line = g_ntohl (*(p++)); - h->visual_class = g_ntohl (*(p++)); - h->red_mask = g_ntohl (*(p++)); - h->green_mask = g_ntohl (*(p++)); - h->blue_mask = g_ntohl (*(p++)); - h->bits_per_rgb = g_ntohl (*(p++)); - h->color_map_entries = g_ntohl (*(p++)); - h->n_colors = g_ntohl (*(p++)); - h->window_width = g_ntohl (*(p++)); - h->window_height = g_ntohl (*(p++)); - h->window_x = g_ntohl (*(p++)); - h->window_y = g_ntohl (*(p++)); - h->window_border_width = g_ntohl (*(p++)); + inp = ∈ + + UNPACK_FIELD_U32 (h, inp, header_size); + UNPACK_FIELD_U32 (h, inp, file_version); + UNPACK_FIELD_U32 (h, inp, pixmap_format); + UNPACK_FIELD_U32 (h, inp, pixmap_depth); + UNPACK_FIELD_U32 (h, inp, pixmap_width); + UNPACK_FIELD_U32 (h, inp, pixmap_height); + UNPACK_FIELD_U32 (h, inp, x_offset); + UNPACK_FIELD_U32 (h, inp, byte_order); + UNPACK_FIELD_U32 (h, inp, bitmap_unit); + UNPACK_FIELD_U32 (h, inp, bitmap_bit_order); + UNPACK_FIELD_U32 (h, inp, bitmap_pad); + UNPACK_FIELD_U32 (h, inp, bits_per_pixel); + UNPACK_FIELD_U32 (h, inp, bytes_per_line); + UNPACK_FIELD_U32 (h, inp, visual_class); + UNPACK_FIELD_U32 (h, inp, red_mask); + UNPACK_FIELD_U32 (h, inp, green_mask); + UNPACK_FIELD_U32 (h, inp, blue_mask); + UNPACK_FIELD_U32 (h, inp, bits_per_rgb); + UNPACK_FIELD_U32 (h, inp, color_map_entries); + UNPACK_FIELD_U32 (h, inp, n_colors); + UNPACK_FIELD_U32 (h, inp, window_width); + UNPACK_FIELD_U32 (h, inp, window_height); + UNPACK_FIELD_S32 (h, inp, window_x); + UNPACK_FIELD_S32 (h, inp, window_y); + UNPACK_FIELD_U32 (h, inp, window_border_width); /* Only support the most common/useful subset of XWD files out there; - * namely, that corresponding to screen dumps from modern X.Org servers. */ + * namely, that corresponding to screen dumps from modern X.Org servers. + * We could check visual_class == 5 too, but the other fields convey all + * the info we need. */ ASSERT_HEADER (h->header_size >= sizeof (XwdHeader)); + ASSERT_HEADER (h->header_size <= 65535); ASSERT_HEADER (h->file_version == 7); ASSERT_HEADER (h->pixmap_depth == 24); + /* Should be zero for truecolor/directcolor. Cap it to prevent overflows. */ + ASSERT_HEADER (h->color_map_entries <= 256); + /* Xvfb sets bits_per_rgb to 8, but 'convert' uses 24 for the same image data. One * of them is likely misunderstanding. Let's be lenient and accept either. */ ASSERT_HEADER (h->bits_per_rgb == 8 || h->bits_per_rgb == 24); + /* These are the pixel formats we allow. */ + ASSERT_HEADER (h->bits_per_pixel == 24 || h->bits_per_pixel == 32); + + /* Enforce sane dimensions. */ + ASSERT_HEADER (h->pixmap_width >= 1 && h->pixmap_width <= 65535); + ASSERT_HEADER (h->pixmap_height >= 1 && h->pixmap_height <= 65535); + + /* Make sure rowstride can actually hold a row's worth of data but is not padded to + * something ridiculous. */ ASSERT_HEADER (h->bytes_per_line >= h->pixmap_width * (h->bits_per_pixel / 8)); + ASSERT_HEADER (h->bytes_per_line <= h->pixmap_width * (h->bits_per_pixel / 8) + 1024); + + /* Make sure the total allocation/map is not too big. */ + ASSERT_HEADER (h->bytes_per_line * h->pixmap_height < (1UL << 31) - 65536 - 256 * 32); + ASSERT_HEADER (compute_pixel_type (loader) < CHAFA_PIXEL_MAX); loader->file_data = file_mapping_get_data (loader->mapping, &loader->file_data_len); @@ -221,11 +245,11 @@ return FALSE; ASSERT_HEADER (loader->file_data_len >= h->header_size - + h->n_colors * sizeof (XwdColor) - + h->pixmap_height * h->bytes_per_line); + + h->color_map_entries * sizeof (XwdColor) + + h->pixmap_height * (gsize) h->bytes_per_line); loader->image_data = (const guint8 *) loader->file_data - + h->header_size + h->n_colors * sizeof (XwdColor); + + h->header_size + h->color_map_entries * sizeof (XwdColor); return TRUE; }