mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@90736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -720,7 +720,9 @@ static int parse_config(void)
|
||||
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");
|
||||
|
Reference in New Issue
Block a user