pgsql: Fix PQsetvalue() to avoid possible crash when adding a new tuple
В списке pgsql-committers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | pgsql: Fix PQsetvalue() to avoid possible crash when adding a new tuple |
| Дата | |
| Msg-id | E1Qjw4K-0000BV-3f@gemulon.postgresql.org обсуждение |
| Список | pgsql-committers |
Fix PQsetvalue() to avoid possible crash when adding a new tuple. PQsetvalue unnecessarily duplicated the logic in pqAddTuple, and didn't duplicate it exactly either --- pqAddTuple does not care what is in the tuple-pointer array positions beyond the last valid entry, whereas the code in PQsetvalue assumed such positions would contain NULL. This led to possible crashes if PQsetvalue was applied to a PGresult that had previously been enlarged with pqAddTuple, for instance one built from a server query. Fix by relying on pqAddTuple instead of duplicating logic, and not assuming anything about the contents of res->tuples[res->ntups]. Back-patch to 8.4, where PQsetvalue was introduced. Andrew Chernow Branch ------ REL9_1_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/64207122a241282189451fdcbab3f5e2a6e1e1b1 Modified Files -------------- src/interfaces/libpq/fe-exec.c | 27 ++++----------------------- 1 files changed, 4 insertions(+), 23 deletions(-)
В списке pgsql-committers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера