From 35ffb2ad774fac945c200d06a30174fe676d94bb Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Mon, 6 Sep 2004 13:35:59 +0000 Subject: [PATCH] Fix bugs; better handle oplevels from ircu2.10.12 * Fix order of port and IP in sample socks4 proxy test. * Fix a bug in dict_remove2() that corrupted the tree order if a cleanup function tried to delete another node. * Fix a buffer overflow in cmd_joiner. * Get rid of free_nick_info() since it is really just free(). * If our P10 uplink sends an oplevel in a burst, treat it as a chanop. git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-78 --- ChangeLog | 23 +++++++++++++++++++++++ sockcheck.conf.example | 2 +- src/dict-splay.c | 11 ++++++----- src/modcmd.c | 2 +- src/nickserv.c | 9 +-------- src/proto-p10.c | 5 ++++- 6 files changed, 36 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index d48ffe0..4791b38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,29 @@ # arch-tag: automatic-ChangeLog--srvx@srvx.net--2004-srvx/srvx--devo--1.3 # +2004-09-06 13:35:59 GMT Michael Poole patch-78 + + Summary: + Fix bugs; better handle oplevels from ircu2.10.12 + Revision: + srvx--devo--1.3--patch-78 + + * Fix order of port and IP in sample socks4 proxy test. + + * Fix a bug in dict_remove2() that corrupted the tree order if a + cleanup function tried to delete another node. + + * Fix a buffer overflow in cmd_joiner. + + * Get rid of free_nick_info() since it is really just free(). + + * If our P10 uplink sends an oplevel in a burst, treat it as a chanop. + + modified files: + ChangeLog sockcheck.conf.example src/dict-splay.c src/modcmd.c + src/nickserv.c src/proto-p10.c + + 2004-08-12 16:06:55 GMT Zoot patch-77 Summary: diff --git a/sockcheck.conf.example b/sockcheck.conf.example index a421a90..b8b684c 100644 --- a/sockcheck.conf.example +++ b/sockcheck.conf.example @@ -17,7 +17,7 @@ * It would be generally wise to replace the $p$i with a hard-coded * one; many insecure proxies refuse to connect to themselves. */ -"1080:0401$i$p=p=r=o=x=y00" { +"1080:0401$p$i=p=r=o=x=y00" { "..5a...." "reject:Unsecured socks4"; }; diff --git a/src/dict-splay.c b/src/dict-splay.c index 38117cd..42bb902 100644 --- a/src/dict-splay.c +++ b/src/dict-splay.c @@ -202,7 +202,7 @@ dict_insert(dict_t dict, const char *key, void *data) int dict_remove2(dict_t dict, const char *key, int no_dispose) { - struct dict_node *new_root; + struct dict_node *new_root, *old_root; if (!dict->root) return 0; @@ -220,13 +220,14 @@ dict_remove2(dict_t dict, const char *key, int no_dispose) if (dict->first == dict->root) dict->first = dict->first->next; if (dict->root->next) dict->root->next->prev = dict->root->prev; if (dict->last == dict->root) dict->last = dict->last->prev; + old_root = dict->root; + dict->root = new_root; + dict->count--; if (no_dispose) { - free(dict->root); + free(old_root); } else { - dict_dispose_node(dict->root, dict->free_keys, dict->free_data); + dict_dispose_node(old_root, dict->free_keys, dict->free_data); } - dict->root = new_root; - dict->count--; return 1; } diff --git a/src/modcmd.c b/src/modcmd.c index 933c791..6e4e59f 100644 --- a/src/modcmd.c +++ b/src/modcmd.c @@ -1464,7 +1464,7 @@ static MODCMD_FUNC(cmd_god) { } static MODCMD_FUNC(cmd_joiner) { - char cmdname[80]; + char cmdname[MAXLEN]; if (argc < 2) { int len = sprintf(cmdname, "%s ", cmd->name); diff --git a/src/nickserv.c b/src/nickserv.c index d48ecab..d11c80a 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -428,13 +428,6 @@ register_nick(const char *nick, struct handle_info *owner) dict_insert(nickserv_nick_dict, ni->nick, ni); } -static void -free_nick_info(void *vni) -{ - struct nick_info *ni = vni; - free(ni); -} - static void delete_nick(struct nick_info *ni) { @@ -3826,7 +3819,7 @@ init_nickserv(const char *nick) dict_set_free_keys(nickserv_id_dict, free); nickserv_nick_dict = dict_new(); - dict_set_free_data(nickserv_nick_dict, free_nick_info); + dict_set_free_data(nickserv_nick_dict, free); nickserv_allow_auth_dict = dict_new(); diff --git a/src/proto-p10.c b/src/proto-p10.c index 9373985..37eb334 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -1076,7 +1076,10 @@ static CMD_FUNC(cmd_burst) mode |= MODE_CHANOP; else if (sep == 'v') mode |= MODE_VOICE; - else + else if (isdigit(sep)) { + mode |= MODE_CHANOP; + while (isdigit(*end)) end++; + } else break; } if (rel_age < 0) -- 2.20.1