Prevent buffer overrun while parsing an integer in a "query_int" value.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Jan 2011 22:41:41 +0000 (17:41 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Jan 2011 22:42:39 +0000 (17:42 -0500)
commit7ccb6dc2d3e266a551827bb99179708580f72431
tree76e80df7cccdf4e2984a5add44f35075c731ba85
parent0ac8c8df85951a6c4815f5e8e0491b6bba4534b7
Prevent buffer overrun while parsing an integer in a "query_int" value.

contrib/intarray's gettoken() uses a fixed-size buffer to collect an
integer's digits, and did not guard against overrunning the buffer.
This is at least a backend crash risk, and in principle might allow
arbitrary code execution.  The code didn't check for overflow of the
integer value either, which while not presenting a crash risk was still
bad.

Thanks to Apple Inc's security team for reporting this issue and supplying
the fix.

Security: CVE-2010-4015
contrib/intarray/_int_bool.c