From f904f0796917993971760591584a0079f6051e13 Mon Sep 17 00:00:00 2001 From: mom040267 Date: Fri, 15 Aug 2014 06:45:01 +0000 Subject: [PATCH] crash fixed on wrong DB connection string --- ChangeLog | 6 ++++-- INSTALL | 3 +-- rpm/build.settings.sh | 2 +- rpm/turnserver.spec | 6 +++--- src/apps/relay/dbdrivers/dbd_mysql.c | 18 ++++++++++-------- src/apps/relay/dbdrivers/dbd_redis.c | 14 ++++++++------ src/ns_turn_defs.h | 2 +- 7 files changed, 28 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 660735e..5e9898d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ -08/03/2014 Oleg Moskalenko -Version 4.1.1.2 'Vitari': +08/14/2014 Oleg Moskalenko +Version 4.1.2.1 'Vitari': - The origin attribute is verified in the subsequent session messages. + - Crash fixed when the DB connection string is incorrect. + - Minor docs fixes. 07/29/2014 Oleg Moskalenko Version 4.1.1.1 'Vitari': diff --git a/INSTALL b/INSTALL index ec69027..c9e5791 100644 --- a/INSTALL +++ b/INSTALL @@ -232,8 +232,7 @@ The following platforms have been used in the development: - FreeBSD 8.x, i386 - PC-BSD 9.x, x86_64 - Solaris 11, x86_64 - - Linux CentOS / Red Hat Enterprise Edition 6.3, x86_64 (amd64) - - Linux CentOS / Red Hat Enterprise Edition 6.4, x86_32 (i386) + - Linux CentOS / Red Hat Enterprise Edition 6.x-7.0, x86_64 (i386 & amd64) - Linux Debian 'Squeeze', i386 - Linux Mint 14.1 'Nadia', i386 - Linux Mint 16 'Petra', i386 diff --git a/rpm/build.settings.sh b/rpm/build.settings.sh index 8103666..acbe1a2 100755 --- a/rpm/build.settings.sh +++ b/rpm/build.settings.sh @@ -2,7 +2,7 @@ # Common settings script. -TURNVERSION=4.1.1.2 +TURNVERSION=4.1.2.1 BUILDDIR=~/rpmbuild ARCH=`uname -p` TURNSERVER_SVN_URL=http://coturn.googlecode.com/svn diff --git a/rpm/turnserver.spec b/rpm/turnserver.spec index 3dd47b7..5d816d2 100644 --- a/rpm/turnserver.spec +++ b/rpm/turnserver.spec @@ -1,5 +1,5 @@ Name: turnserver -Version: 4.1.1.2 +Version: 4.1.2.1 Release: 0%{dist} Summary: Coturn TURN Server @@ -293,8 +293,8 @@ fi %{_includedir}/turn/client/TurnMsgLib.h %changelog -* Sun Aug 03 2014 Oleg Moskalenko - - Sync to 4.1.1.2 +* Thu Aug 14 2014 Oleg Moskalenko + - Sync to 4.1.2.1 * Tue Jul 29 2014 Oleg Moskalenko - Sync to 4.1.1.1 * Tue Jul 22 2014 Oleg Moskalenko diff --git a/src/apps/relay/dbdrivers/dbd_mysql.c b/src/apps/relay/dbdrivers/dbd_mysql.c index 42f5c2d..4681dba 100644 --- a/src/apps/relay/dbdrivers/dbd_mysql.c +++ b/src/apps/relay/dbdrivers/dbd_mysql.c @@ -142,14 +142,16 @@ static Myconninfo *MyconninfoParse(char *userdb, char **errmsg) { turn_free(s0, strlen(s0)+1); } - if(!(co->dbname)) - co->dbname=strdup("0"); - if(!(co->host)) - co->host=strdup("127.0.0.1"); - if(!(co->user)) - co->user=strdup(""); - if(!(co->password)) - co->password=strdup(""); + if(co) { + if(!(co->dbname)) + co->dbname=strdup("0"); + if(!(co->host)) + co->host=strdup("127.0.0.1"); + if(!(co->user)) + co->user=strdup(""); + if(!(co->password)) + co->password=strdup(""); + } return co; } diff --git a/src/apps/relay/dbdrivers/dbd_redis.c b/src/apps/relay/dbdrivers/dbd_redis.c index c0eaa48..c368ec3 100644 --- a/src/apps/relay/dbdrivers/dbd_redis.c +++ b/src/apps/relay/dbdrivers/dbd_redis.c @@ -148,12 +148,14 @@ static Ryconninfo *RyconninfoParse(const char *userdb, char **errmsg) { turn_free(s0, strlen(s0)+1); } - if(!(co->dbname)) - co->dbname=strdup("0"); - if(!(co->host)) - co->host=strdup("127.0.0.1"); - if(!(co->password)) - co->password=strdup(""); + if(co) { + if(!(co->dbname)) + co->dbname=strdup("0"); + if(!(co->host)) + co->host=strdup("127.0.0.1"); + if(!(co->password)) + co->password=strdup(""); + } return co; } diff --git a/src/ns_turn_defs.h b/src/ns_turn_defs.h index 79b361b..1eba81b 100644 --- a/src/ns_turn_defs.h +++ b/src/ns_turn_defs.h @@ -31,7 +31,7 @@ #ifndef __IOADEFS__ #define __IOADEFS__ -#define TURN_SERVER_VERSION "4.1.1.2" +#define TURN_SERVER_VERSION "4.1.2.1" #define TURN_SERVER_VERSION_NAME "Vitari" #define TURN_SOFTWARE "Coturn-" TURN_SERVER_VERSION " '" TURN_SERVER_VERSION_NAME "'"