From d4908646057e071195a98e324ff99ac1647226dd Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Wed, 2 Feb 2005 22:29:08 +0000 Subject: [PATCH] Always initialize MOTD hostmask pointer. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1309 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 3 +++ ircd/motd.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index c09464e..d1ce540 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ G-lines by plain hostname (not *@host), thus preventing "GLINE test ..." from inserting duplicate G-lines. + * ircd/motd.c (motd_create): Null out new Motd's hostmask when + appropriate, avoiding an uninitialized or stale pointer. + 2005-01-26 Michael Poole * include/ircd_alloc.h (DoMallocZero): Parenthesize macro diff --git a/ircd/motd.c b/ircd/motd.c index dc92c97..d0627e8 100644 --- a/ircd/motd.c +++ b/ircd/motd.c @@ -94,6 +94,8 @@ motd_create(const char *hostmask, const char *path, int maxcount) if (hostmask != NULL) DupString(tmp->hostmask, hostmask); + else + tmp->hostmask = NULL; DupString(tmp->path, path); tmp->maxcount = maxcount; -- 2.20.1