postgresql/contrib/tablefunc
Joe Conway 4a3cdb531b 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
2019-12-23 13:34:12 -05:00
..
data Have crosstab variants treat NULL rowid as a category in its own right, 2007-11-10 05:00:41 +00:00
expected Handle unexpected query results, especially NULLs, safely in connectby(). 2015-01-29 20:18:37 -05:00
sql Handle unexpected query results, especially NULLs, safely in connectby(). 2015-01-29 20:18:37 -05:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
Makefile Convert contrib modules to use the extension facility. 2011-02-13 22:54:49 -05:00
tablefunc--1.0.sql Throw a useful error message if an extension script file is fed to psql. 2011-10-12 15:45:03 -04:00
tablefunc--unpackaged--1.0.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:28 +02:00
tablefunc.c Disallow null category in crosstab_hash 2019-12-23 13:34:12 -05:00
tablefunc.control Convert contrib modules to use the extension facility. 2011-02-13 22:54:49 -05:00
tablefunc.h Update copyright for 2014 2014-01-07 16:05:30 -05:00