]> Pileus Git - ~andy/fetchmail/commitdiff
Prevernt formation of pathological lists.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 24 Mar 1998 04:39:59 +0000 (04:39 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 24 Mar 1998 04:39:59 +0000 (04:39 -0000)
svn path=/trunk/; revision=1722

fetchmail.c
uid.c

index 43799cc128daae2167d4d4a51a138f53e7d9f687..a9bf2348f84b286b320c32c0320182cb47e797aa 100644 (file)
@@ -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 ac49a013b9fa3f2fff86febfec4eebebb50ad706..8e51bb3289f0c5c72026d5e60c89ef3657428a2d 100644 (file)
--- 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;