[asterisk-commits] tilghman: trunk r90737 - in /trunk: ./ res/res_config_pgsql.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 3 17:29:58 CST 2007


Author: tilghman
Date: Mon Dec  3 17:29:57 2007
New Revision: 90737

URL: http://svn.digium.com/view/asterisk?view=rev&rev=90737
Log:
Merged revisions 90736 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r90736 | tilghman | 2007-12-03 17:23:55 -0600 (Mon, 03 Dec 2007) | 5 lines

If both dbhost and dbsock were not set, a NULL deref could result
Reported by: xrg
Patch by: tilghman
(Closes issue #11387)

........

Modified:
    trunk/   (props changed)
    trunk/res/res_config_pgsql.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/res/res_config_pgsql.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_config_pgsql.c?view=diff&rev=90737&r1=90736&r2=90737
==============================================================================
--- trunk/res/res_config_pgsql.c (original)
+++ trunk/res/res_config_pgsql.c Mon Dec  3 17:29:57 2007
@@ -862,7 +862,9 @@
 		dbport = atoi(s);
 	}
 
-	if (!ast_strlen_zero(dbhost) && !(s = ast_variable_retrieve(config, "general", "dbsock"))) {
+	if (!ast_strlen_zero(dbhost)) {
+		/* No socket needed */
+	} else if (!(s = ast_variable_retrieve(config, "general", "dbsock"))) {
 		ast_log(LOG_WARNING,
 				"PostgreSQL RealTime: No database socket found, using '/tmp/pgsql.sock' as default.\n");
 		strcpy(dbsock, "/tmp/pgsql.sock");




More information about the asterisk-commits mailing list