From d52579e54c21ee83be60da75b79fa78cb19f3abc9b5c9505347d1916dbbd9287 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Thu, 15 Oct 2020 14:22:35 +0000 Subject: [PATCH 1/2] - fix [bsc#1177579] -- wrong clamping of hexadezimal digits in dc - deleted patches - bc-1.06-dc_ibase.patch (upstreamed) OBS-URL: https://build.opensuse.org/package/show/Base:System/bc?expand=0&rev=21 --- bc-1.06-dc_ibase.patch | 60 ------------------------------------------ bc.changes | 7 +++++ bc.spec | 6 ++--- 3 files changed, 9 insertions(+), 64 deletions(-) delete mode 100644 bc-1.06-dc_ibase.patch diff --git a/bc-1.06-dc_ibase.patch b/bc-1.06-dc_ibase.patch deleted file mode 100644 index 2648ece..0000000 --- a/bc-1.06-dc_ibase.patch +++ /dev/null @@ -1,60 +0,0 @@ -Index: dc/numeric.c -=================================================================== ---- dc/numeric.c.orig -+++ dc/numeric.c -@@ -307,6 +307,8 @@ dc_getnum DC_DECLARG((input, ibase, read - int digit; - int decimal; - int c; -+ int c_buff = 0; -+ int multi = 0; - - bc_init_num(&tmp); - bc_init_num(&build); -@@ -324,6 +326,9 @@ dc_getnum DC_DECLARG((input, ibase, read - } - while (isspace(c)) - c = (*input)(); -+ c_buff = (*input)(); -+ if (isdigit(c_buff) || ('A' <= c_buff && c_buff <= 'F') || c_buff == '.') -+ multi = 1; - for (;;){ - if (isdigit(c)) - digit = c - '0'; -@@ -331,10 +336,15 @@ dc_getnum DC_DECLARG((input, ibase, read - digit = 10 + c - 'A'; - else - break; -- c = (*input)(); -+ digit = multi ? (digit >= ibase ? ibase -1 : digit) : digit; - bc_int2num(&tmp, digit); - bc_multiply(result, base, &result, 0); - bc_add(result, tmp, &result, 0); -+ if (c_buff) { -+ c = c_buff; -+ c_buff = 0; -+ } else -+ c = (*input)(); - } - if (c == '.'){ - bc_free_num(&build); -@@ -343,13 +353,18 @@ dc_getnum DC_DECLARG((input, ibase, read - build = bc_copy_num(_zero_); - decimal = 0; - for (;;){ -- c = (*input)(); -+ if (c_buff) { -+ c = c_buff; -+ c_buff = 0; -+ } else -+ c = (*input)(); - if (isdigit(c)) - digit = c - '0'; - else if ('A' <= c && c <= 'F') - digit = 10 + c - 'A'; - else - break; -+ digit = digit >= ibase ? ibase -1 : digit; - bc_int2num(&tmp, digit); - bc_multiply(build, base, &build, 0); - bc_add(build, tmp, &build, 0); diff --git a/bc.changes b/bc.changes index a2caa06..aba6422 100644 --- a/bc.changes +++ b/bc.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Oct 15 14:20:20 UTC 2020 - pgajdos@suse.com + +- fix [bsc#1177579] -- wrong clamping of hexadezimal digits in dc +- deleted patches + - bc-1.06-dc_ibase.patch (upstreamed) + ------------------------------------------------------------------- Wed Aug 28 11:33:46 CEST 2019 - kukuk@suse.de diff --git a/bc.spec b/bc.spec index 6fc2466..561c076 100644 --- a/bc.spec +++ b/bc.spec @@ -1,7 +1,7 @@ # # spec file for package bc # -# Copyright (c) 2019 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 @@ -22,11 +22,10 @@ Release: 0 Summary: GNU Command Line Calculator License: GPL-2.0-or-later Group: Productivity/Scientific/Math -Url: https://www.gnu.org/software/bc/ +URL: https://www.gnu.org/software/bc/ Source0: https://ftp.gnu.org/gnu/bc/bc-%{version}.tar.gz Source1: https://ftp.gnu.org/gnu/bc/bc-%{version}.tar.gz.sig Source2: %{name}.keyring -Patch1: bc-1.06-dc_ibase.patch # Correct return value after 'q' [bsc#1129038] Patch2: bc-dc-correct-return-value.patch BuildRequires: bison @@ -58,7 +57,6 @@ and "pushes" its results back onto the stack. %prep %setup -q -%patch1 %patch2 -p1 %build From ba0a4f966fd95dae28ecb4f2e33bf707777d1c8ba5b308c7cc1921ca48c01e46 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Thu, 15 Oct 2020 14:23:08 +0000 Subject: [PATCH 2/2] - fix [bsc#1177579] -- wrong clamping of hexadecimal digits in dc OBS-URL: https://build.opensuse.org/package/show/Base:System/bc?expand=0&rev=22 --- bc.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bc.changes b/bc.changes index aba6422..f578f66 100644 --- a/bc.changes +++ b/bc.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Thu Oct 15 14:20:20 UTC 2020 - pgajdos@suse.com -- fix [bsc#1177579] -- wrong clamping of hexadezimal digits in dc +- fix [bsc#1177579] -- wrong clamping of hexadecimal digits in dc - deleted patches - bc-1.06-dc_ibase.patch (upstreamed)