[asterisk-commits] tilghman: branch 1.4 r90736 - /branches/1.4/res/res_config_pgsql.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Dec 3 17:23:55 CST 2007
Author: tilghman
Date: Mon Dec 3 17:23:55 2007
New Revision: 90736
URL: http://svn.digium.com/view/asterisk?view=rev&rev=90736
Log:
If both dbhost and dbsock were not set, a NULL deref could result
Reported by: xrg
Patch by: tilghman
(Closes issue #11387)
Modified:
branches/1.4/res/res_config_pgsql.c
Modified: branches/1.4/res/res_config_pgsql.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/res/res_config_pgsql.c?view=diff&rev=90736&r1=90735&r2=90736
==============================================================================
--- branches/1.4/res/res_config_pgsql.c (original)
+++ branches/1.4/res/res_config_pgsql.c Mon Dec 3 17:23:55 2007
@@ -720,7 +720,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