summaryrefslogtreecommitdiff
path: root/mail/exim3/patches/patch-ap
blob: 49c700a553f0876a5b77bd0c21327270959474ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$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++;