Hello community, here is the log from the commit of package tnef for openSUSE:Factory checked in at 2020-09-17 14:49:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/tnef (Old) and /work/SRC/openSUSE:Factory/.tnef.new.4249 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "tnef" Thu Sep 17 14:49:47 2020 rev:25 rq:834965 version:1.4.18 Changes: -------- --- /work/SRC/openSUSE:Factory/tnef/tnef.changes 2018-02-07 18:41:22.980268093 +0100 +++ /work/SRC/openSUSE:Factory/.tnef.new.4249/tnef.changes 2020-09-17 14:52:20.131996019 +0200 @@ -1,0 +2,7 @@ +Wed Sep 16 06:51:03 UTC 2020 - Dirk Mueller <[email protected]> + +- update to 1.4.18: + * Improve safety of strdups + * Correct possible improper bitshift. + +------------------------------------------------------------------- Old: ---- tnef-1.4.17.tar.gz New: ---- tnef-1.4.18.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ tnef.spec ++++++ --- /var/tmp/diff_new_pack.Ai3CVu/_old 2020-09-17 14:52:21.275997111 +0200 +++ /var/tmp/diff_new_pack.Ai3CVu/_new 2020-09-17 14:52:21.275997111 +0200 @@ -1,7 +1,7 @@ # # spec file for package tnef # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,17 +12,17 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: tnef -Version: 1.4.17 +Version: 1.4.18 Release: 0 Summary: Uncompress MS-TNEF Archives -License: GPL-2.0+ +License: GPL-2.0-or-later Group: Productivity/Archiving/Compression -Url: https://github.com/verdammelt/tnef/ +URL: https://github.com/verdammelt/tnef/ Source: https://github.com/verdammelt/tnef/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz BuildRequires: libtool ++++++ tnef-1.4.17.tar.gz -> tnef-1.4.18.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tnef-1.4.17/ChangeLog new/tnef-1.4.18/ChangeLog --- old/tnef-1.4.17/ChangeLog 2018-01-14 03:01:21.000000000 +0100 +++ new/tnef-1.4.18/ChangeLog 2019-11-11 00:57:12.000000000 +0100 @@ -1,3 +1,11 @@ +2019-11-10 Paul Dreik <pauldreik@github> + * src/alloc.c, src/alloc.h + * src/attr.c src/mapi_attr.c + Ensure null termination of strdups in the face of potentially + malicious inputs. + + * src/util.h: fix shift into sign bit. + 2018-01-13 Mark Simpson <[email protected]> * configure.ac, tests/cmdline/version.baseline: Update version number. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tnef-1.4.17/NEWS new/tnef-1.4.18/NEWS --- old/tnef-1.4.17/NEWS 2018-01-14 03:01:21.000000000 +0100 +++ new/tnef-1.4.18/NEWS 2019-11-11 00:57:12.000000000 +0100 @@ -1,5 +1,11 @@ TNEF NEWS -- history of user-visible changes. 31 August 2014 -Copyright (C) 2000-2017 by Mark Simpson +Copyright (C) 2000-2019 by Mark Simpson + +* 1.4.18 [10 Nov 2019] +** Improve safety of strdups +*** https://github.com/verdammelt/tnef/pull/40 +** Correct possible improper bitshift. +*** https://github.com/verdammelt/tnef/pull/41 * 1.4.17 [13 Jan 2018] ** Fix embarrassing version number problem. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tnef-1.4.17/configure.ac new/tnef-1.4.18/configure.ac --- old/tnef-1.4.17/configure.ac 2018-01-14 03:01:21.000000000 +0100 +++ new/tnef-1.4.18/configure.ac 2019-11-11 00:57:12.000000000 +0100 @@ -1,5 +1,5 @@ AC_PREREQ(2.59) -AC_INIT([tnef],[1.4.17],[[email protected]]) +AC_INIT([tnef],[1.4.18],[[email protected]]) AC_CONFIG_SRCDIR([src/tnef.c]) AM_INIT_AUTOMAKE AC_CONFIG_HEADER([src/config.h]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tnef-1.4.17/src/alloc.c new/tnef-1.4.18/src/alloc.c --- old/tnef-1.4.17/src/alloc.c 2018-01-14 03:01:21.000000000 +0100 +++ new/tnef-1.4.18/src/alloc.c 2019-11-11 00:57:12.000000000 +0100 @@ -76,13 +76,14 @@ /* attempts to malloc memory, if fails print error and call abort */ void* -xmalloc (size_t num, size_t size) +xmalloc (size_t num, size_t size, size_t extra) { size_t res; if (check_mul_overflow(num, size, &res)) abort(); - - void *ptr = malloc (res); + if (res + extra < res) + abort(); + void *ptr = malloc (res + extra); if (!ptr && (size != 0)) /* some libc don't like size == 0 */ { @@ -94,41 +95,44 @@ /* Allocates memory but only up to a limit */ void* -checked_xmalloc (size_t num, size_t size) +checked_xmalloc (size_t num, size_t size, size_t extra) { size_t res; if (check_mul_overflow(num, size, &res)) abort(); - + if (res + extra < res) + abort(); alloc_limit_assert ("checked_xmalloc", res); - return xmalloc (num, size); + return xmalloc (num, size, extra); } /* xmallocs memory and clears it out */ void* -xcalloc (size_t num, size_t size) +xcalloc (size_t num, size_t size, size_t extra) { size_t res; if (check_mul_overflow(num, size, &res)) abort(); void *ptr; - ptr = malloc(res); + if (res + extra < res) + abort(); + ptr = malloc(res + extra); if (ptr) { - memset (ptr, '\0', (res)); + memset (ptr, '\0', (res + extra)); } return ptr; } /* xcallocs memory but only up to a limit */ void* -checked_xcalloc (size_t num, size_t size) +checked_xcalloc (size_t num, size_t size, size_t extra) { size_t res; if (check_mul_overflow(num, size, &res)) abort(); alloc_limit_assert ("checked_xcalloc", (res)); - return xcalloc (num, size); + return xcalloc (num, size, extra); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tnef-1.4.17/src/alloc.h new/tnef-1.4.18/src/alloc.h --- old/tnef-1.4.17/src/alloc.h 2018-01-14 03:01:21.000000000 +0100 +++ new/tnef-1.4.18/src/alloc.h 2019-11-11 00:57:12.000000000 +0100 @@ -35,19 +35,23 @@ extern void set_alloc_limit (size_t size); extern size_t get_alloc_limit(); extern void alloc_limit_assert (char *fn_name, size_t size); -extern void* checked_xmalloc (size_t num, size_t size); -extern void* xmalloc (size_t num, size_t size); -extern void* checked_xcalloc (size_t num, size_t size); -extern void* xcalloc (size_t num, size_t size); +extern void* checked_xmalloc (size_t num, size_t size, size_t extra); +extern void* xmalloc (size_t num, size_t size, size_t extra); +extern void* checked_xcalloc (size_t num, size_t size, size_t extra); +extern void* xcalloc (size_t num, size_t size, size_t extra); #define XMALLOC(_type,_num) \ - ((_type*)xmalloc((_num), sizeof(_type))) + ((_type*)xmalloc((_num), sizeof(_type), 0)) #define XCALLOC(_type,_num) \ - ((_type*)xcalloc((_num), sizeof (_type))) + ((_type*)xcalloc((_num), sizeof (_type), 0)) #define CHECKED_XMALLOC(_type,_num) \ - ((_type*)checked_xmalloc((_num),sizeof(_type))) -#define CHECKED_XCALLOC(_type,_num) \ - ((_type*)checked_xcalloc((_num),sizeof(_type))) + ((_type*)checked_xmalloc((_num),sizeof(_type),0)) +#define CHECKED_XMALLOC_ADDNULL(_type,_num) \ + ((_type*)checked_xmalloc((_num),sizeof(_type),1)) +#define CHECKED_XCALLOC(_type,_num) \ + ((_type*)checked_xcalloc((_num),sizeof(_type),0)) +#define CHECKED_XCALLOC_ADDNULL(_type,_num) \ + ((_type*)checked_xcalloc((_num),sizeof(_type),1)) #define XFREE(_ptr) \ do { if (_ptr) { free (_ptr); _ptr = 0; } } while (0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tnef-1.4.17/src/attr.c new/tnef-1.4.18/src/attr.c --- old/tnef-1.4.17/src/attr.c 2018-01-14 03:01:21.000000000 +0100 +++ new/tnef-1.4.18/src/attr.c 2019-11-11 00:57:12.000000000 +0100 @@ -256,7 +256,11 @@ attr->type = (type_and_name >> 16); attr->name = ((type_and_name << 16) >> 16); attr->len = geti32(in); - attr->buf = CHECKED_XCALLOC (unsigned char, attr->len); + /* Allocate an extra byte for the null terminator, + in case the input lacks it, + this avoids strdup() being invoked on possibly non-terminated + input later (file.c, file_add_attr()). */ + attr->buf = CHECKED_XCALLOC_ADDNULL(unsigned char, attr->len); (void)getbuf(in, attr->buf, attr->len); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tnef-1.4.17/src/main.c new/tnef-1.4.18/src/main.c --- old/tnef-1.4.17/src/main.c 2018-01-14 03:01:21.000000000 +0100 +++ new/tnef-1.4.18/src/main.c 2019-11-11 00:57:12.000000000 +0100 @@ -251,7 +251,7 @@ case 'V': fprintf (stderr, "%s\n", PACKAGE_STRING); fprintf (stderr, - "Copyright (C) 1999-2018 by Mark Simpson\n" + "Copyright (C) 1999-2019 by Mark Simpson\n" "Copyright (C) 1997 by Thomas Boll (original code)"); fprintf (stderr, "\n"); fprintf (stderr, NO_WARRANTY, PACKAGE_NAME, PACKAGE_NAME); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tnef-1.4.17/src/mapi_attr.c new/tnef-1.4.18/src/mapi_attr.c --- old/tnef-1.4.17/src/mapi_attr.c 2018-01-14 03:01:21.000000000 +0100 +++ new/tnef-1.4.18/src/mapi_attr.c 2019-11-11 00:57:12.000000000 +0100 @@ -316,8 +316,10 @@ } else { - v->data.buf = CHECKED_XMALLOC(unsigned char, v->len); + /* add space for a null terminator, in case of evil input */ + v->data.buf = CHECKED_XMALLOC_ADDNULL(unsigned char, v->len); memmove (v->data.buf, buf+idx, v->len); + v->data.buf[v->len] = '\0'; } idx += pad_to_4byte(v->len); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tnef-1.4.17/src/util.c new/tnef-1.4.18/src/util.c --- old/tnef-1.4.17/src/util.c 2018-01-14 03:01:21.000000000 +0100 +++ new/tnef-1.4.18/src/util.c 2019-11-11 00:57:12.000000000 +0100 @@ -31,10 +31,8 @@ /* Needed to transform char buffers into little endian numbers */ uint32 GETINT32(unsigned char *p) { - return (uint32)((uint8)(p)[0] \ - +((uint8)(p)[1]<<8) \ - +((uint8)(p)[2]<<16) \ - +((uint8)(p)[3]<<24)); + uint8* q=(uint8*)p; + return q[0] + (q[1]<<8) + (q[2]<<16)+ (((uint32)q[3])<<24); } uint16 GETINT16 (unsigned char* p) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tnef-1.4.17/tests/cmdline/version.baseline new/tnef-1.4.18/tests/cmdline/version.baseline --- old/tnef-1.4.17/tests/cmdline/version.baseline 2018-01-14 03:01:21.000000000 +0100 +++ new/tnef-1.4.18/tests/cmdline/version.baseline 2019-11-11 00:57:12.000000000 +0100 @@ -1,6 +1,6 @@ ./../../src/tnef --version -tnef 1.4.17 -Copyright (C) 1999-2018 by Mark Simpson +tnef 1.4.18 +Copyright (C) 1999-2019 by Mark Simpson Copyright (C) 1997 by Thomas Boll (original code) tnef comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of tnef under the terms of the GNU General @@ -8,8 +8,8 @@ named COPYING. ./../../src/tnef -V -tnef 1.4.17 -Copyright (C) 1999-2018 by Mark Simpson +tnef 1.4.18 +Copyright (C) 1999-2019 by Mark Simpson Copyright (C) 1997 by Thomas Boll (original code) tnef comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of tnef under the terms of the GNU General
