]> Pileus Git - ~andy/fetchmail/commitdiff
Merge 2004-03-25-6.2.5-egidy-parserec.diff.
authorMatthias Andree <matthias.andree@gmx.de>
Tue, 12 Oct 2004 22:07:29 +0000 (22:07 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Tue, 12 Oct 2004 22:07:29 +0000 (22:07 -0000)
Gerd v. Egidy writes:

a received header looking like this

Received: from code ([20.191.144.116])
          by

currently causes fetchmail 6.2.5 to segfault when in multidrop/received mode.

Looks like there is a check for \0 missing in parse_received, the
attached patch fixes this.
(Committer's note: the sample looks incomplete but anyways the patch
makes sense to me.)

svn path=/trunk/; revision=3941

transact.c

index c246df892c52cafdd7ae17f09c06d6d02319724d..0c246a1d2689cd776fd905d12fd88ac63f6d61e2 100644 (file)
@@ -217,7 +217,7 @@ static char *parse_received(struct query *ctl, char *bufp)
            for (sp = ok + 2; isspace((unsigned char)*sp); sp++)
                continue;
            tp = rbuf;
-           for (; !isspace((unsigned char)*sp); sp++)
+           for (; *sp && !isspace((unsigned char)*sp); sp++)
                RBUF_WRITE(*sp);
            *tp = '\0';