diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-06-16 17:16:32 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-06-16 17:16:32 -0400 |
commit | 4c56f3269a84a81461cc53941e0eee02fc920ab6 (patch) | |
tree | d1bc9a958a31a490ca9206cb180214a4cba042a7 /src/backend/utils/adt/inet_net_pton.c | |
parent | bfb937427be2cfca78e3e076c30e37cddc350f8e (diff) | |
download | postgresql-4c56f3269a84a81461cc53941e0eee02fc920ab6.tar.gz postgresql-4c56f3269a84a81461cc53941e0eee02fc920ab6.zip |
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>
Diffstat (limited to 'src/backend/utils/adt/inet_net_pton.c')
-rw-r--r-- | src/backend/utils/adt/inet_net_pton.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/inet_net_pton.c b/src/backend/utils/adt/inet_net_pton.c index 9064eaf64b0..b8fa7d2bccf 100644 --- a/src/backend/utils/adt/inet_net_pton.c +++ b/src/backend/utils/adt/inet_net_pton.c @@ -496,7 +496,7 @@ inet_cidr_pton_ipv6(const char *src, u_char *dst, size_t size) else if (*src == '\0') goto enoent; if (tp + NS_INT16SZ > endp) - return (0); + goto enoent; *tp++ = (u_char) (val >> 8) & 0xff; *tp++ = (u_char) val & 0xff; saw_xdigit = 0; |