$NetBSD: patch-ap,v 1.1 2006/03/06 22:49:16 joerg Exp $ --- src/host.c.orig 2006-02-14 16:41:01.000000000 +0100 +++ src/host.c @@ -620,12 +620,18 @@ if (strchr(address, ':') != NULL) if (*p == ':') p++; - /* Split the address into components separated by colons. */ + /* Split the address into components separated by colons. The input address + is supposed to be checked for syntax. There was a case where this was + overlooked; to guard against that happening again, check here and crash if + there is a violation. */ while (*p != 0) { int len = strcspn(p, ":"); if (len == 0) nulloffset = ci; + if (ci > 7) log_write(0, LOG_MAIN|LOG_PANIC_DIE, + "Internal error: invalid IPv6 address \"%s\" passed to host_aton()", + address); component[ci++] = p; p += len; if (*p == ':') p++;