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 18:45:18 -0400 |
commit | 754e99d51799e94057ffb182f8870d5df5dc8c8e (patch) | |
tree | f7193b069b8629f392af460a938d91a5868caf52 /cel | |
parent | 1d1309b1ed0da8e862e55d2fb0f021043d722ecd (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 4ab3878fd..a79bfab74 100644 --- a/cel/cel_pgsql.c +++ b/cel/cel_pgsql.c @@ -325,6 +325,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; } @@ -385,8 +386,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); |