From 1915e074759eca660211ad52e6f954a372df0a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= Date: Wed, 22 Dec 2010 10:34:13 +0100 Subject: [PATCH] fix possible segfault in arrays handling(debbug #586969), initialize f_void to work with math lib again(#664080) --- bc-1.06.95-matlib.patch | 20 ++++++++++++++++++++ bc.spec | 10 ++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 bc-1.06.95-matlib.patch diff --git a/bc-1.06.95-matlib.patch b/bc-1.06.95-matlib.patch new file mode 100644 index 0000000..796c5e2 --- /dev/null +++ b/bc-1.06.95-matlib.patch @@ -0,0 +1,20 @@ +diff -urNp bc-1.06.95-orig/bc/storage.c bc-1.06.95/bc/storage.c +--- bc-1.06.95-orig/bc/storage.c 2006-09-05 04:39:31.000000000 +0200 ++++ bc-1.06.95/bc/storage.c 2010-12-22 10:26:43.805250912 +0100 +@@ -99,6 +99,7 @@ more_functions (VOID) + { + f = &functions[indx]; + f->f_defined = FALSE; ++ f->f_void = FALSE; + f->f_body = (char *) bc_malloc (BC_START_SIZE); + f->f_body_size = BC_START_SIZE; + f->f_code_size = 0; +@@ -179,7 +180,7 @@ more_arrays () + + + /* Initialize the new elements. */ +- for (; indx < v_count; indx++) ++ for (; indx < a_count; indx++) + arrays[indx] = NULL; + + /* Free the old elements. */ diff --git a/bc.spec b/bc.spec index d105560..e4bad65 100644 --- a/bc.spec +++ b/bc.spec @@ -1,13 +1,14 @@ Summary: GNU's bc (a numeric processing language) and dc (a calculator) Name: bc Version: 1.06.95 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: http://www.gnu.org/software/bc/ Group: Applications/Engineering Source: ftp://alpha.gnu.org/pub/gnu/bc/bc-%{version}.tar.bz2 Patch1: bc-1.06-dc_ibase.patch Patch2: bc-1.06.95-memleak.patch +Patch3: bc-1.06.95-matlib.patch Requires(post): /sbin/install-info Requires(preun): /sbin/install-info Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -26,6 +27,7 @@ if you would like to use its text mode calculator. %setup -q %patch1 -p1 -b .dc_ibase %patch2 -p1 -b .memleak +%patch3 -p1 -b .matlib %build %configure --with-readline @@ -65,7 +67,11 @@ fi %{_infodir}/* %changelog -* Thu Sep 24 2009 Ondrej Vasik 1.06-95-1 +* Wed Dec 22 2010 Ondrej Vasik 1.06.95-2 +- fix possible segfault in arrays handling(debbug #586969) +- initialize f_void to work with math lib again(#664080) + +* Thu Sep 24 2009 Ondrej Vasik 1.06.95-1 - update to upstream alpha 1.06.95 (in use in Gentoo, Slackware for quite a long time, marked stable there) - removed already applied patches, fix small memory leak