Skip to content
Browse files

Fix parsing of very long literal IPv6 addresses.

Patch due to Jan Braun.
  • Loading branch information...
1 parent 52bbb86 commit 68b4f4e8f7860e09682421ff40f64ef4fd3f7396 @jech committed Jul 13, 2011
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);

0 comments on commit 68b4f4e

Please sign in to comment.
Something went wrong with that request. Please try again.