Assert name/short_desc to prevent SHOW ALL segfault
Steve Chavez <steve@supabase.io>
From: Steve Chavez <steve@supabase.io>
To: pgsql-hackers@postgresql.org
Date: 2022-05-24T04:39:16Z
Lists: pgsql-hackers
Attachments
- 0001-Assert-name-short_desc-to-prevent-SHOWALL-segfault.patch (text/x-patch) patch 0001
Hello hackers, The DefineCustomStringVariable function(or any other DefineCustomXXXVariable) has a short_desc parameter that can be NULL and it's not apparent that this will lead to a segfault when SHOW ALL is used. This happens because the ShowAllGUCConfig function expects a non-NULL short_desc. This happened for the Supabase supautils extension( https://github.com/supabase/supautils/issues/24) and any other extension that uses the DefineCustomXXXVariable has the same bug risk. This patch does an Assert on the short_desc(also on the name as an extra measure), so a postgres built with --enable-cassert can prevent the above issue. --- Steve Chavez Engineering at https://supabase.com/
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Introduce pg_attribute_nonnull(...)
- 0507977aa4a3 16.0 landed
-
Handle NULL for short descriptions of custom GUC variables
- 1b40ceea24e6 10.22 landed
- c3db8a2e2ea4 11.17 landed
- ae236bf660f5 12.12 landed
- 1e6802990cdd 13.8 landed
- fe441a031940 14.4 landed
- f1431f3bffa0 15.0 landed