diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-03 23:29:57 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-03 23:29:57 +0000 |
commit | 13d1f2b914722f30d845a3326929f89e39c7a48e (patch) | |
tree | a3e93a44de3c7cfd7630690243c1a16561d4b7f5 | |
parent | 2ee1c8934584f0b74a80078c7bb5c23af1e4eaf9 (diff) |
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)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@90737 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | res/res_config_pgsql.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c index 579334af5..ee31b48ef 100644 --- a/res/res_config_pgsql.c +++ b/res/res_config_pgsql.c @@ -862,7 +862,9 @@ static int parse_config(int reload) 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"); |