From 40fc85400652467428c2c31ff251494321d7805a Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Sun, 21 May 2017 15:03:29 -0700 Subject: [PATCH] Release calc version 2.12.5.6 --- CHANGES | 10 +++++++++- Makefile | 4 ++-- Makefile.simple | 4 ++-- custom/Makefile | 2 +- custom/Makefile.head | 2 +- custom/Makefile.simple | 2 +- lib_calc.c | 33 ++++++++++++++++++++++++++++++++- version.c | 4 ++-- 8 files changed, 50 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 13e5c4a..d17f420 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,12 @@ -The following are the changes from calc version 2.12.5.4 to date: +The following are the changes from calc version 2.12.5.6 to date: + + Fixed a crash that showed up on Mac OS that was reported + by Richard Outerbridge and + fixed by Stuart Henderson . + Thanks goes to both! + + +The following are the changes from calc version 2.12.5.4 to 2.12.5.5: Recompile to match current RHEL7.2 libc and friends. diff --git a/Makefile b/Makefile index 92f2253..7a7f5ca 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ # MAKEFILE_REV= $$Revision: 30.88 $$ # @(#) $Id: Makefile.ship,v 30.88 2017/05/21 01:26:42 chongo Exp $ -# @(#) $Source: /usr/local/src/bin/calc-RHEL7/RCS/Makefile.ship,v $ +# @(#) $Source: /usr/local/src/bin/calc/RCS/Makefile.ship,v $ # # Under source code control: 1990/02/15 01:48:41 # File existed as early as: before 1990 @@ -992,7 +992,7 @@ EXT= # The default calc versions # -VERSION= 2.12.5.5 +VERSION= 2.12.5.6 # Names of shared libraries with versions # diff --git a/Makefile.simple b/Makefile.simple index 56883a7..3b9a89d 100644 --- a/Makefile.simple +++ b/Makefile.simple @@ -41,7 +41,7 @@ # MAKEFILE_REV= $$Revision: 30.88 $$ # @(#) $Id: Makefile.ship,v 30.88 2017/05/21 01:26:42 chongo Exp $ -# @(#) $Source: /usr/local/src/bin/calc-RHEL7/RCS/Makefile.ship,v $ +# @(#) $Source: /usr/local/src/bin/calc/RCS/Makefile.ship,v $ # # Under source code control: 1990/02/15 01:48:41 # File existed as early as: before 1990 @@ -961,7 +961,7 @@ EXT= # The default calc versions # -VERSION= 2.12.5.5 +VERSION= 2.12.5.6 # Names of shared libraries with versions # diff --git a/custom/Makefile b/custom/Makefile index 4e7a8e5..c3f7f40 100644 --- a/custom/Makefile +++ b/custom/Makefile @@ -352,7 +352,7 @@ EXT= # The default calc versions # -VERSION= 2.12.5.5 +VERSION= 2.12.5.6 # Names of shared libraries with versions # diff --git a/custom/Makefile.head b/custom/Makefile.head index 9576f9d..a1afcde 100644 --- a/custom/Makefile.head +++ b/custom/Makefile.head @@ -352,7 +352,7 @@ EXT= # The default calc versions # -VERSION= 2.12.5.5 +VERSION= 2.12.5.6 # Names of shared libraries with versions # diff --git a/custom/Makefile.simple b/custom/Makefile.simple index 15dd42b..c665f02 100644 --- a/custom/Makefile.simple +++ b/custom/Makefile.simple @@ -337,7 +337,7 @@ EXT= # The default calc versions # -VERSION= 2.12.5.5 +VERSION= 2.12.5.6 # Names of shared libraries with versions # diff --git a/lib_calc.c b/lib_calc.c index 6e0fe22..5383678 100644 --- a/lib_calc.c +++ b/lib_calc.c @@ -259,9 +259,40 @@ libcalc_call_me_first(void) * initialize old and new configuration values */ newstd.epsilon = &_qonesqbase_; /* magic to fake early str2q() */ + if (program == NULL) { + fprintf(stderr, "libcalc_call_me_first: FATAL: " + "program is NULL\n"); + exit(80); + } newstd.program = strdup(program); + if (newstd.program == NULL) { + fprintf(stderr, "libcalc_call_me_first: FATAL: " + "cannot strdup program string\n"); + exit(81); + } + if (base_name == NULL) { + fprintf(stderr, "libcalc_call_me_first: FATAL: " + "base_name is NULL\n"); + exit(82); + } newstd.base_name = strdup(base_name); - newstd.version = strdup(version()); + if (newstd.base_name == NULL) { + fprintf(stderr, "libcalc_call_me_first: FATAL: " + "cannot strdup base_name string\n"); + exit(83); + } + p = version(); + if (p == NULL) { + fprintf(stderr, "libcalc_call_me_first: FATAL: " + "version() returned NULL\n"); + exit(84); + } + newstd.version = strdup(p); + if (newstd.version == NULL) { + fprintf(stderr, "libcalc_call_me_first: FATAL: " + "cannot strdup return from version()\n"); + exit(85); + } conf = config_copy(&newstd); /* more magic to fake early str2q() */ conf->tab_ok = FALSE; newstd.epsilon = str2q(EPSILON_DEFAULT); diff --git a/version.c b/version.c index 7d1ad67..bcb56bf 100644 --- a/version.c +++ b/version.c @@ -49,7 +49,7 @@ static char *program; #define MAJOR_VER 2 /* major library version */ #define MINOR_VER 12 /* minor library version */ #define MAJOR_PATCH 5 /* major software level under library version */ -#define MINOR_PATCH 5 /* minor software level or 0 if not patched */ +#define MINOR_PATCH 6 /* minor software level or 0 if not patched */ /* @@ -134,7 +134,7 @@ version(void) fprintf(stderr, "%s: cannot malloc version string\n", program); exit(70); } - strncpy(stored_version, verbuf, BUFSIZ); + strncpy(stored_version, verbuf, len); stored_version[len] = '\0'; /* paranoia */ /*