Always initialize MOTD hostmask pointer.
authorMichael Poole <mdpoole@troilus.org>
Wed, 2 Feb 2005 22:29:08 +0000 (22:29 +0000)
committerMichael Poole <mdpoole@troilus.org>
Wed, 2 Feb 2005 22:29:08 +0000 (22:29 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1309 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/motd.c

index c09464e6ca9482610f3cd244a88a98dd1bb1920e..d1ce5403947cb73e5afb34d183c1a54213757182 100644 (file)
--- 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 <mdpoole@troilus.org>
 
        * include/ircd_alloc.h (DoMallocZero): Parenthesize macro
index dc92c97e260d897a6c1a2b79d6e9a0b33956e9e8..d0627e8f17bcc66ab891cdbd8b6dc541209a089f 100644 (file)
@@ -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;