From: Eric S. Raymond Date: Tue, 24 Mar 1998 04:39:59 +0000 (-0000) Subject: Prevernt formation of pathological lists. X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=30abdc40501b9675ead72fa59ae138fc4336de47;p=~andy%2Ffetchmail Prevernt formation of pathological lists. svn path=/trunk/; revision=1722 --- diff --git a/fetchmail.c b/fetchmail.c index 43799cc1..a9bf2348 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -694,6 +694,12 @@ static int load_params(int argc, char **argv, int optind) ctl = hostalloc(&cmd_opts); ctl->server.pollname = xstrdup(argv[optind]); + /* avoid making pathological circular lists */ + ctl->server.localdomains = (struct idlist *)NULL; + ctl->localnames = (struct idlist *)NULL; + ctl->mailboxes = (struct idlist *)NULL; + ctl->smtphunt = (struct idlist *)NULL; + foundit: ctl->active = TRUE; } diff --git a/uid.c b/uid.c index ac49a013..8e51bb32 100644 --- a/uid.c +++ b/uid.c @@ -277,7 +277,9 @@ int delete_str(struct idlist **idl, int num) void append_str_list(struct idlist **idl, struct idlist **nidl) /* append nidl to idl (does not copy *) */ { - if ((*idl) == (struct idlist *)NULL) + if ((*nidl) == (struct idlist *)NULL) + return; + else if ((*idl) == (struct idlist *)NULL) *idl = *nidl; else if ((*idl)->next == (struct idlist *)NULL) (*idl)->next = *nidl;