diff options
author | Sean Bright <sean.bright@gmail.com> | 2017-03-30 09:11:46 -0400 |
---|---|---|
committer | Sean Bright <sean.bright@gmail.com> | 2017-03-30 17:48:42 -0500 |
commit | c537f994883718d6f4fac3447dae185b88b327a0 (patch) | |
tree | dbc88c9d5054114a31b9bc676f6b604920b89166 /cel | |
parent | 7898aad02d6f64e0558b7891c547812b2d65c911 (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.c | 3 |
1 files changed, 1 insertions, 2 deletions
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); |