diff options
author | Nei <ailin.nemui@gmail.com> | 2018-02-06 06:45:54 +0000 |
---|---|---|
committer | Nei <ailin.nemui@gmail.com> | 2018-02-06 06:45:54 +0000 |
commit | a73659e0ea5d50c4da7a4da805cda13068098646 (patch) | |
tree | 2caa3fda955822be2b28a842fac3529f4b6707da | |
parent | 41e2b535ef13d23f71d7e99c19afa913e9c257c3 (diff) | |
parent | 0909d47e5b5ab08cd07970a374e311f7f54be547 (diff) | |
download | irssi-a73659e0ea5d50c4da7a4da805cda13068098646.zip |
Merge branch 'soperise' into 'security'
Soperise
See merge request irssi/irssi!32
-rw-r--r-- | src/fe-common/irc/fe-irc-commands.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c index 11a911d2..7a6b17a6 100644 --- a/src/fe-common/irc/fe-irc-commands.c +++ b/src/fe-common/irc/fe-irc-commands.c @@ -345,16 +345,18 @@ static void cmd_ts(const char *data) } typedef struct { - IRC_SERVER_REC *server; + char *server_tag; char *nick; } OPER_PASS_REC; static void cmd_oper_got_pass(const char *password, OPER_PASS_REC *rec) { - if (*password != '\0') - irc_send_cmdv(rec->server, "OPER %s %s", rec->nick, password); + SERVER_REC *server_rec = server_find_tag(rec->server_tag); + if (*password != '\0' && IS_IRC_SERVER(server_rec)) + irc_send_cmdv((IRC_SERVER_REC *) server_rec, "OPER %s %s", rec->nick, password); g_free(rec->nick); - g_free(rec); + g_free(rec->server_tag); + g_free(rec); } static void cmd_oper(const char *data, IRC_SERVER_REC *server) @@ -374,7 +376,7 @@ static void cmd_oper(const char *data, IRC_SERVER_REC *server) OPER_PASS_REC *rec; rec = g_new(OPER_PASS_REC, 1); - rec->server = server; + rec->server_tag = g_strdup(server->tag); rec->nick = g_strdup(*nick != '\0' ? nick : server->nick); format = format_get_text(MODULE_NAME, NULL, server, NULL, |