pgsql: Minor cleanup/future-proofing for pg_saslprep().

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Minor cleanup/future-proofing for pg_saslprep().
Дата
Msg-id E1fylb5-00007s-UN@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Minor cleanup/future-proofing for pg_saslprep().

Ensure that pg_saslprep() initializes its output argument to NULL in
all failure paths, and then remove the redundant initialization that
some (not all) of its callers did.  This does not fix any live bug,
but it reduces the odds of future bugs of omission.

Also add a comment about why the existing failure-path coding is
adequate.

Back-patch so as to keep the function's API consistent across branches,
again to forestall future bug introduction.

Patch by me, reviewed by Michael Paquier

Discussion: https://postgr.es/m/16558.1536407783@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f47f3148011f1cb5dc34396382fc2f434844d247

Modified Files
--------------
src/backend/libpq/auth-scram.c       |  4 ++--
src/common/saslprep.c                | 11 ++++++++---
src/interfaces/libpq/fe-auth-scram.c |  4 ++--
3 files changed, 12 insertions(+), 7 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: pgsql: Remove duplicated words split across lines in comments
Следующее
От: Noah Misch
Дата:
Сообщение: pgsql: Fix logical subscriber wait in test.