From a0893a20e50af2deb56e6cfee0b455e310a5805a Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 26 Mar 1998 21:25:51 +0000 Subject: Prevent pathological circular lists. svn path=/trunk/; revision=1730 --- rcfile_y.y | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'rcfile_y.y') diff --git a/rcfile_y.y b/rcfile_y.y index 49e85fc4..6bec2e54 100644 --- a/rcfile_y.y +++ b/rcfile_y.y @@ -434,7 +434,8 @@ struct query *init; /* pointer to block containing initial values */ node = (struct query *) xmalloc(sizeof(struct query)); /* initialize it */ - memcpy(node, init, sizeof(struct query)); + if (init) + memcpy(node, init, sizeof(struct query)); /* append to end of list */ if (hosttail != (struct query *) 0) @@ -458,6 +459,11 @@ static void record_current(void) /* register current parameters and append to the host list */ { #define FLAG_FORCE(fld) if (cmd_opts.fld) current.fld = cmd_opts.fld + FLAG_FORCE(server.localdomains); + FLAG_FORCE(localnames); + FLAG_FORCE(mailboxes); + FLAG_FORCE(smtphunt); + FLAG_FORCE(server.via); FLAG_FORCE(server.protocol); #if INET6 @@ -484,10 +490,6 @@ static void record_current(void) FLAG_FORCE(remotename); FLAG_FORCE(password); - if (cmd_opts.mailboxes) - current.mailboxes = cmd_opts.mailboxes; - if (cmd_opts.smtphunt) - current.smtphunt = cmd_opts.smtphunt; FLAG_FORCE(mda); FLAG_FORCE(smtpaddress); FLAG_FORCE(antispam); -- cgit v1.2.3