From 26988d56bb8b56fc7918ef2a63b06b4a2da6047a Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Sat, 23 Sep 2006 01:03:08 +0000 Subject: [PATCH] Dummy handling fixes. 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 | 17 +++++++++++++++++ src/proto-p10.c | 10 ++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ca8a5e..9c732ad 100644 --- 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 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 patch-47 Summary: diff --git a/src/proto-p10.c b/src/proto-p10.c index bb82d45..eab4ac6 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -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