dect
/
asterisk
Archived
13
0
Fork 0

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
This commit is contained in:
tilghman 2007-12-03 23:29:57 +00:00
parent 2ee1c89345
commit 13d1f2b914
1 changed files with 3 additions and 1 deletions

View File

@ -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");