summaryrefslogtreecommitdiff
path: root/cel
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2017-03-30 09:11:46 -0400
committerSean Bright <sean.bright@gmail.com>2017-03-30 18:47:51 -0400
commitc9707febe3b41ffd17741254084c9a26f9039935 (patch)
tree478b0db23b6dce9d92d7b7d1648c189d906203e6 /cel
parentf99ef618b4af3705a038129f1ef395ed6a71fac0 (diff)
cdr_pgsql: Fix buffer overflow calling libpq
Implement the same buffer size checking done in cel_pgsql. ASTERISK-26896 #close Reported by: twisted Change-Id: Iaacfa1f1de7cb1e9414d121850d2d8c2888f3f48
Diffstat (limited to 'cel')
-rw-r--r--cel/cel_pgsql.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/cel/cel_pgsql.c b/cel/cel_pgsql.c
index 7ce76d298..4d61709d3 100644
--- a/cel/cel_pgsql.c
+++ b/cel/cel_pgsql.c
@@ -322,6 +322,7 @@ static void pgsql_log(struct ast_event *event)
char *tmpbuf = ast_realloc(escapebuf, required_size);
if (!tmpbuf) {
+ AST_RWLIST_UNLOCK(&psql_columns);
goto ast_log_cleanup;
}
@@ -382,8 +383,6 @@ static void pgsql_log(struct ast_event *event)
ast_log(LOG_ERROR, "Reason: %s\n", pgerror);
}
}
- PQclear(result);
- goto ast_log_cleanup;
}
PQclear(result);