Skip to content

Commit 4c56f32

Browse files
committed
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>
1 parent bfb9374 commit 4c56f32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/inet_net_pton.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ inet_cidr_pton_ipv6(const char *src, u_char *dst, size_t size)
496496
else if (*src == '\0')
497497
goto enoent;
498498
if (tp + NS_INT16SZ > endp)
499-
return (0);
499+
goto enoent;
500500
*tp++ = (u_char) (val >> 8) & 0xff;
501501
*tp++ = (u_char) val & 0xff;
502502
saw_xdigit = 0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy