postgresql/src/pl
Robert Haas c98ad086ad Bounds-check access to TupleDescAttr with an Assert.
The second argument to TupleDescAttr should always be at least zero
and less than natts; otherwise, we index outside of the attribute
array. Assert that this is the case.

Various violations, or possible violations, of this rule that are
currently in the tree are actually harmless, because while
we do call TupleDescAttr() before verifying that the argument is
within range, we don't actually dereference it unless the argument
was within range all along. Nonetheless, the Assert means we
should be more careful, so tidy up accordingly.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: http://postgr.es/m/CA+TgmoacixUZVvi00hOjk_d9B4iYKswWP1gNqQ8Vfray-AcOCA@mail.gmail.com
2026-03-24 08:58:50 -04:00
..
plperl Bounds-check access to TupleDescAttr with an Assert. 2026-03-24 08:58:50 -04:00
plpgsql Bounds-check access to TupleDescAttr with an Assert. 2026-03-24 08:58:50 -04:00
plpython EUC_CN, EUC_JP, EUC_KR, EUC_TW: Skip U+00A0 tests instead of failing. 2026-02-25 18:13:22 -08:00
tcl Reduce header inclusions via execnodes.h 2026-03-16 14:34:57 +01:00
Makefile Make distprep and *clean build targets recurse into all subdirectories. 2011-07-03 13:55:12 -04:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00