Avoid fetching past the end of the indoption array.
authorTom Lane
Sun, 7 Apr 2019 22:18:59 +0000 (18:18 -0400)
committerTom Lane
Sun, 7 Apr 2019 22:18:59 +0000 (18:18 -0400)
commita7ca25cf787c563a92eef5eff1a8d2bb1364a992
tree049bd58d61d4d85069e443d086dac85dbe439a4d
parent10e3991fad8a300ed268878ae30c96074628c1e1
Avoid fetching past the end of the indoption array.

pg_get_indexdef_worker carelessly fetched indoption entries even for
non-key index columns that don't have one.  99.999% of the time this
would be harmless, since the code wouldn't examine the value ... but
some fine day this will be a fetch off the end of memory, resulting
in SIGSEGV.

Detected through valgrind testing.  Odd that the buildfarm's valgrind
critters haven't noticed.
src/backend/utils/adt/ruleutils.c