Fix integer-overflow problem in intarray's g_int_decompress().
commitcf6f802bf538ab1c9c0ef60a6e9d6fafdfb06b98
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 Jan 2024 20:19:50 +0000 (7 15:19 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 Jan 2024 20:19:50 +0000 (7 15:19 -0500)
treeed20680f27d8c7a05e5fff4e814fbabf89c91de2
parent714a987bc1333121bb83415f764076c8e7e8d8fb
Fix integer-overflow problem in intarray's g_int_decompress().

An array element equal to INT_MAX gave this code indigestion,
causing an infinite loop that surely ended in SIGSEGV.  We fixed
some nearby problems awhile ago (cf 757c5182f) but missed this.

Report and diagnosis by Alexander Lakhin (bug #18273); patch by me

Discussion: https://postgr.es/m/18273-9a832d1da122600c@postgresql.org
contrib/intarray/_int_gist.c
contrib/intarray/data/test__int.data
contrib/intarray/expected/_int.out
contrib/intarray/sql/_int.sql