]> granicus.if.org Git - postgresql/commit
Fix misparsing of empty value in conninfo_uri_parse_params().
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 21 Feb 2015 17:59:25 +0000 (12:59 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 21 Feb 2015 17:59:43 +0000 (12:59 -0500)
commit83c3115dd0dda495d8cbe47c5eea33df13f2881e
tree417779f0391920cc2253107e35db9bed3b560fbc
parentc86f8f3615c43aba45a031028500988d1e694aaf
Fix misparsing of empty value in conninfo_uri_parse_params().

After finding an "=" character, the pointer was advanced twice when it
should only advance once.  This is harmless as long as the value after "="
has at least one character; but if it doesn't, we'd miss the terminator
character and include too much in the value.

In principle this could lead to reading off the end of memory.  It does not
seem worth treating as a security issue though, because it would happen on
client side, and besides client logic that's taking conninfo strings from
untrusted sources has much worse security problems than this.

Report and patch received off-list from Thomas Fanghaenel.
Back-patch to 9.2 where the faulty code was introduced.
src/interfaces/libpq/fe-connect.c