From c537f994883718d6f4fac3447dae185b88b327a0 Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Thu, 30 Mar 2017 09:11:46 -0400 Subject: 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 --- cel/cel_pgsql.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cel') diff --git a/cel/cel_pgsql.c b/cel/cel_pgsql.c index eba0726da..5fe66784b 100644 --- a/cel/cel_pgsql.c +++ b/cel/cel_pgsql.c @@ -320,6 +320,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; } @@ -380,8 +381,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); -- cgit v1.2.3