mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-04 05:27:19 +02:00
Fix validation of overly-long IPv6 addresses.
The inet/cidr types sometimes failed to reject IPv6 inputs with too many colon-separated fields, instead translating them to '::/0'. This is the result of a thinko in the original ISC code that seems to be as yet unreported elsewhere. Per bug #14198 from Stefan Kaltenbrunner. Report: <20160616182222.5798.959@wrigleys.postgresql.org>
This commit is contained in:
parent
4f5995dd98
commit
a41b14f94a
@ -496,7 +496,7 @@ inet_cidr_pton_ipv6(const char *src, u_char *dst, size_t size)
|
|||||||
else if (*src == '\0')
|
else if (*src == '\0')
|
||||||
goto enoent;
|
goto enoent;
|
||||||
if (tp + NS_INT16SZ > endp)
|
if (tp + NS_INT16SZ > endp)
|
||||||
return (0);
|
goto enoent;
|
||||||
*tp++ = (u_char) (val >> 8) & 0xff;
|
*tp++ = (u_char) (val >> 8) & 0xff;
|
||||||
*tp++ = (u_char) val & 0xff;
|
*tp++ = (u_char) val & 0xff;
|
||||||
saw_xdigit = 0;
|
saw_xdigit = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user