[Pkg-privacy-commits] [irssi-plugin-otr] 113/267: Fix: segfault on NULL server object and target

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:41:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository irssi-plugin-otr.

commit a3df1e0db0734ce6a140385bae962a643521ced7
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Tue Nov 6 17:41:33 2012 -0500

    Fix: segfault on NULL server object and target
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/cmd.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/cmd.c b/src/cmd.c
index 67b90a8..053fca9 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -222,9 +222,23 @@ static void _cmd_init(IOUSTATE *ioustate, SERVER_REC *irssi, int argc,
 {
 	char *msg;
 
+	/* No server object, just ignore the request */
+	if (!irssi) {
+		goto end;
+	}
+
+	if (!target) {
+		IRSSI_WARN(irssi, irssi->nick, "%9OTR:%9 Use /otr init only in a "
+				"private message window.");
+		goto end;
+	}
+
 	msg = otrl_proto_default_query_msg(target, OTRL_POLICY_DEFAULT);
 	irc_send_message(irssi, target, msg ? msg : "?OTRv23?");
 	free(msg);
+
+end:
+	return;
 }
 
 static struct irssi_commands cmds[] = {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/irssi-plugin-otr.git



More information about the Pkg-privacy-commits mailing list