Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix parsing of very long literal IPv6 addresses.

Patch due to Jan Braun.
  • Loading branch information...
commit 68b4f4e8f7860e09682421ff40f64ef4fd3f7396 1 parent 52bbb86
@jech authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 dns.c
View
4 dns.c
@@ -443,11 +443,11 @@ dnsDelayedNotify(int error, GethostbynameRequestPtr request)
AtomPtr
rfc2732(AtomPtr name)
{
- char buf[38];
+ char buf[40]; /* 8*4 (hexdigits) + 7 (colons) + 1 ('\0') */
int rc;
AtomPtr a = NULL;
- if(name->length < 38 &&
+ if(name->length < 40+2 &&
name->string[0] == '[' && name->string[name->length - 1] == ']') {
struct in6_addr in6a;
memcpy(buf, name->string + 1, name->length - 2);
Please sign in to comment.
Something went wrong with that request. Please try again.