mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user