postgresql/src/fe_utils
Tom Lane f864a4cdfc In fmtIdEnc(), handle failure of enlargePQExpBuffer().
Coverity complained that we weren't doing that, and it's right.

This fix just makes fmtIdEnc() honor the general convention that OOM
causes a PQExpBuffer to become marked "broken", without any immediate
error.  In the pretty-unlikely case that we actually did hit OOM here,
the end result would be to return an empty string to the caller,
probably resulting in invalid SQL syntax in an issued command (if
nothing else went wrong, which is even more unlikely).  It's tempting
to throw an "out of memory" error if the buffer becomes broken, but
there's not a lot of point in doing that only here and not in hundreds
of other PQExpBuffer-using places in pg_dump and similar callers.
The whole issue could do with some non-time-crunched redesign, perhaps.

This is a followup to the fixes for CVE-2025-1094, and should be
included if cherry-picking those fixes.
2025-02-16 12:46:35 -05:00
..
.gitignore Move psql's psqlscan.l into src/fe_utils. 2016-03-24 20:28:47 -04:00
archive.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
cancel.c Avoid calling gettext() in signal handlers. 2022-01-17 13:30:04 -05:00
conditional.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
connect_utils.c Move some code from src/bin/scripts to src/fe_utils to permit reuse. 2021-02-05 13:33:38 -05:00
Makefile Move some code from src/bin/scripts to src/fe_utils to permit reuse. 2021-02-05 13:33:38 -05:00
mbprint.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
option_utils.c Move some code from src/bin/scripts to src/fe_utils to permit reuse. 2021-02-05 13:33:38 -05:00
parallel_slot.c Don't spuriously report FD_SETSIZE exhaustion on Windows. 2023-10-14 15:54:49 -07:00
print.c Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
psqlscan.l psql: Fix line continuation prompts for unbalanced parentheses 2021-04-29 09:04:31 +02:00
query_utils.c Move some code from src/bin/scripts to src/fe_utils to permit reuse. 2021-02-05 13:33:38 -05:00
recovery_gen.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
simple_list.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
string_utils.c In fmtIdEnc(), handle failure of enlargePQExpBuffer(). 2025-02-16 12:46:35 -05:00