From a479ab8df59e1cb1abd30d0b91d7032dd0abc7b4 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Wed, 6 May 2009 06:28:33 +0200 Subject: [PATCH] socat crashed on systems without setenv() --- CHANGES | 4 ++++ VERSION | 2 +- utils.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 4f328b1..99600e6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ +corrections: + socat crashed on systems without setenv() (esp. SunOS up to Solaris 9); + thanks to Todd Stansell for reporting this bug + ####################### V 1.7.1.0: new features: diff --git a/VERSION b/VERSION index 978ec68..67b3a53 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -"1.7.1.0" +"1.7.1.0+fixsetenv" diff --git a/utils.c b/utils.c index 57904d9..21ccf79 100644 --- a/utils.c +++ b/utils.c @@ -75,7 +75,7 @@ int setenv(const char *name, const char *value, int overwrite) { if (!overwrite) { if (getenv(name)) return 0; /* already exists */ } - if ((env = Malloc(strlen(name)+strlen(value)+2)) != NULL) { + if ((env = Malloc(strlen(name)+strlen(value)+2)) == NULL) { return -1; } sprintf(env, "%s=%s", name, value);