postgresql/contrib/btree_gist
Tom Lane 82bbb60c30 Fix valgrind warning for btree_gist indexes on macaddr.
The macaddr opclass stores two macaddr structs (each of size 6) in an
index column that's declared as being of type gbtreekey16, ie 16 bytes.
In the original coding this led to passing a palloc'd value of size 12
to the index insertion code, so that data would be fetched past the
end of the allocated value during index tuple construction.  This makes
valgrind unhappy.  In principle it could result in a SIGSEGV, though
with the current implementation of palloc there's no risk since
the 12-byte request size would be rounded up to 16 bytes anyway.

To fix, add a field to struct gbtree_ninfo showing the declared size of
the index datums, and use that in the palloc requests; and use palloc0
to be sure that any wasted bytes are cleanly initialized.

Per report from Andres Freund.  No back-patch since there's no current
risk of a real problem.
2014-05-16 15:11:51 -04:00
..
data Add missing newlines at end of files 2010-10-26 20:11:43 +03:00
expected Reduce messages about implicit indexes and sequences to DEBUG1. 2012-07-04 20:35:29 -04:00
sql Add KNNGIST support to contrib/btree_gist. 2011-03-02 14:44:33 -05:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
btree_bit.c Initialize padding bytes in btree_gist varbit support. 2014-05-13 15:15:13 +03:00
btree_bytea.c Create function prototype as part of PG_FUNCTION_INFO_V1 macro 2014-04-18 00:03:19 -04:00
btree_cash.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_date.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_float4.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_float8.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_gist--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
btree_gist--unpackaged--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
btree_gist.c Create function prototype as part of PG_FUNCTION_INFO_V1 macro 2014-04-18 00:03:19 -04:00
btree_gist.control Convert contrib modules to use the extension facility. 2011-02-13 22:54:49 -05:00
btree_gist.h Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
btree_inet.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_int2.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_int4.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_int8.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_interval.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_macaddr.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_numeric.c Create function prototype as part of PG_FUNCTION_INFO_V1 macro 2014-04-18 00:03:19 -04:00
btree_oid.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_text.c Create function prototype as part of PG_FUNCTION_INFO_V1 macro 2014-04-18 00:03:19 -04:00
btree_time.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_ts.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_utils_num.c Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_utils_num.h Fix valgrind warning for btree_gist indexes on macaddr. 2014-05-16 15:11:51 -04:00
btree_utils_var.c Create function prototype as part of PG_FUNCTION_INFO_V1 macro 2014-04-18 00:03:19 -04:00
btree_utils_var.h Remove unnecessary #include references, per pgrminclude script. 2011-09-01 10:04:27 -04:00
Makefile Add -lm to SHLIB_LINK for contrib/btree_gist. 2011-03-03 01:43:38 -05:00