pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Disallow null category in crosstab_hash
Date: Mon, 23 Dec 2019 18:36:32 +0000
Message-ID: <E1ijSZE-00052F-FA@gemulon.postgresql.org> (raw)

Disallow null category in crosstab_hash

While building a hash map of categories in load_categories_hash,
resulting category names have not thus far been checked to ensure
they are not null. Prior to pg12 null category names worked to the
extent that they did not crash on some platforms. This is because
those system libraries have an snprintf which can deal with being
passed a null pointer argument for a string. But even in those cases
null categories did nothing useful. And on some platforms it crashed.
As of pg12, our own version of snprintf gets called, and it does
not deal with null pointer arguments at all, and crashes consistently.

Fix that by disallowing null categories. They never worked usefully,
and no one has ever asked for them to work previously. Back-patch to
all supported branches.

Reported-By: Ireneusz Pluta
Discussion: https://postgr.es/m/16176-7489719b05e4303c@postgresql.org

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/70fc6c4ef3c3790284796db3935d6f2d040b60bd

Modified Files
--------------
contrib/tablefunc/tablefunc.c | 5 +++++
1 file changed, 5 insertions(+)



view thread (7+ messages)  latest in thread

Message-ID: <E1ijSZE-00052F-FA@gemulon.postgresql.org>
Permalink:  ../E1ijSZE-00052F-FA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ijSZE-00052F-FA@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: mail@joeconway.com
  Subject: Re: pgsql: Disallow null category in crosstab_hash
  In-Reply-To: <E1ijSZE-00052F-FA@gemulon.postgresql.org>
  References: <E1ijSZE-00052F-FA@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox