Dummy handling fixes.
authorMichael Poole <mdpoole@troilus.org>
Sat, 23 Sep 2006 01:03:08 +0000 (01:03 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 23 Sep 2006 01:03:08 +0000 (01:03 +0000)
src/proto-p10.c (irc_notice): Fix the conditions for sending message to
    IRC.
  (irc_privmsg): Likewise.
  (parse_cleanup): Zero num_*_funcs when freeing the corresponding
    arrays, so that DelUser() doesn't read after free.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-48

ChangeLog
src/proto-p10.c

index 9ca8a5e689ba3835e327b2bfa73dba6c049c7297..9c732adc6934458b9e51e7ebcfb8b52b4c507681 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,23 @@
 # arch-tag: automatic-ChangeLog--srvx@srvx.net--2006/srvx--devo--1.3
 #
 
+2006-09-23 01:03:08 GMT        Michael Poole <mdpoole@troilus.org>     patch-48
+
+    Summary:
+      Dummy handling fixes.
+    Revision:
+      srvx--devo--1.3--patch-48
+
+    src/proto-p10.c (irc_notice): Fix the conditions for sending message to
+        IRC.
+      (irc_privmsg): Likewise.
+      (parse_cleanup): Zero num_*_funcs when freeing the corresponding
+        arrays, so that DelUser() doesn't read after free.
+
+    modified files:
+     ChangeLog src/proto-p10.c
+
+
 2006-09-23 00:58:27 GMT        Michael Poole <mdpoole@troilus.org>     patch-47
 
     Summary:
index bb82d450419ccff7ceaf818c08a7ec0e4a14dd2f..eab4ac6a0a219ba279f6196977599b2b8525bc6d 100644 (file)
@@ -578,8 +578,8 @@ deliver_to_dummy(struct userNode *source, struct userNode *dest, const char *mes
 void
 irc_notice(struct userNode *from, const char *to, const char *message)
 {
-    if (to[0] != '#' && to[0] != '$'
-        && !deliver_to_dummy(from, GetUserN(to), message, 0))
+    if (to[0] == '#' || to[0] == '$'
+        || !deliver_to_dummy(from, GetUserN(to), message, 0))
         putsock("%s " P10_NOTICE " %s :%s", from->numeric, to, message);
 }
 
@@ -593,8 +593,8 @@ irc_notice_user(struct userNode *from, struct userNode *to, const char *message)
 void
 irc_privmsg(struct userNode *from, const char *to, const char *message)
 {
-    if (to[0] != '#' && to[0] != '$'
-        && !deliver_to_dummy(from, GetUserN(to), message, 1))
+    if (to[0] == '#' || to[0] == '$'
+        || !deliver_to_dummy(from, GetUserN(to), message, 1))
         putsock("%s " P10_PRIVMSG " %s :%s", from->numeric, to, message);
 }
 
@@ -1534,7 +1534,9 @@ parse_cleanup(void)
     unsigned int nn;
     free(of_list);
     free(privmsg_funcs);
+    num_privmsg_funcs = 0;
     free(notice_funcs);
+    num_notice_funcs = 0;
     free(mcf_list);
     dict_delete(irc_func_dict);
     for (nn=0; nn<dead_users.used; nn++)