Hello community, here is the log from the commit of package slang for openSUSE:Factory checked in at 2018-10-01 09:06:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/slang (Old) and /work/SRC/openSUSE:Factory/.slang.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "slang" Mon Oct 1 09:06:14 2018 rev:33 rq:637425 version:2.3.1a Changes: -------- --- /work/SRC/openSUSE:Factory/slang/slang.changes 2018-03-16 10:35:38.921109417 +0100 +++ /work/SRC/openSUSE:Factory/.slang.new/slang.changes 2018-10-01 09:06:21.943843833 +0200 @@ -1,0 +2,5 @@ +Mon Sep 24 10:40:13 UTC 2018 - [email protected] + +- overflow.patch: fix overflow checks not to depend on undefined behaviour + +------------------------------------------------------------------- New: ---- overflow.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ slang.spec ++++++ --- /var/tmp/diff_new_pack.gaQlS1/_old 2018-10-01 09:06:22.743843146 +0200 +++ /var/tmp/diff_new_pack.gaQlS1/_new 2018-10-01 09:06:22.743843146 +0200 @@ -32,6 +32,7 @@ Patch2: slang-fsuid.patch # PATCH-FIX-UPSTREAM Patch5: git-6dd5ade9a97b52ace4ac033779a6d3c1c51db4d1.patch +Patch6: overflow.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: pcre-devel @@ -93,6 +94,7 @@ %patch1 -p1 %patch2 -p1 %patch5 -p0 +%patch6 -p1 %build mv autoconf/configure.ac . ++++++ overflow.patch ++++++ Index: slang-2.3.1a/src/slarray.c =================================================================== --- slang-2.3.1a.orig/src/slarray.c +++ slang-2.3.1a/src/slarray.c @@ -22,6 +22,7 @@ USA. #include "slinclud.h" #include <math.h> +#include <limits.h> /* #define SL_APP_WANTS_FOREACH */ #include "slang.h" @@ -368,13 +369,13 @@ SLang_create_array1 (SLtype type, int re { SLindex_Type new_num_elements; at->dims[i] = dims[i]; - new_num_elements = dims[i] * num_elements; - if (dims[i] && (new_num_elements/dims[i] != num_elements)) + if (dims[i] && (INT_MAX/dims[i] < num_elements)) { throw_size_error (SL_Index_Error); free_array (at); return NULL; } + new_num_elements = dims[i] * num_elements; num_elements = new_num_elements; } @@ -395,13 +396,13 @@ SLang_create_array1 (SLtype type, int re return at; } - size = (num_elements * sizeof_type); - if ((size/sizeof_type != num_elements) || (size < 0)) + if (INT_MAX/sizeof_type < num_elements) { throw_size_error (SL_INVALID_PARM); free_array (at); return NULL; } + size = (num_elements * sizeof_type); if (size == 0) size = 1;
