diff options
author | David Hill <dhill@conformal.com> | 2014-06-19 09:56:57 -0400 |
---|---|---|
committer | David Hill <dhill@conformal.com> | 2014-06-20 00:07:47 -0400 |
commit | 70a55030d14ea2ec29fe0386872b13b7f27765f7 (patch) | |
tree | 9a5a6d628794f7e889a1802ba1eb3838ccc64102 | |
parent | 9d0d4d9437649ed96381120e68a8d4035f6ded7e (diff) | |
download | irssi-70a55030d14ea2ec29fe0386872b13b7f27765f7.zip |
Avoid potential null dereferences.
-rw-r--r-- | src/irc/core/irc-commands.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c index 301b3300..44e4b8a2 100644 --- a/src/irc/core/irc-commands.c +++ b/src/irc/core/irc-commands.c @@ -74,7 +74,7 @@ static void cmd_notice(const char *data, IRC_SERVER_REC *server, return; if (strcmp(target, "*") == 0) target = item == NULL ? NULL : window_item_get_target(item); - if (*target == '\0' || *msg == '\0') + if (target == NULL || *target == '\0' || *msg == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); recoded = recode_out(SERVER(server), msg, target); @@ -101,7 +101,7 @@ static void cmd_ctcp(const char *data, IRC_SERVER_REC *server, return; if (strcmp(target, "*") == 0) target = item == NULL ? NULL : window_item_get_target(item); - if (*target == '\0' || *ctcpcmd == '\0') + if (target == NULL || *target == '\0' || *ctcpcmd == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); ascii_strup(ctcpcmd); @@ -135,7 +135,7 @@ static void cmd_nctcp(const char *data, IRC_SERVER_REC *server, return; if (strcmp(target, "*") == 0) target = item == NULL ? NULL : window_item_get_target(item); - if (*target == '\0' || *ctcpcmd == '\0') + if (target == NULL || *target == '\0' || *ctcpcmd == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); ascii_strup(ctcpcmd); |