diff options
author | Alexander Færøy <ahf@0x90.dk> | 2014-06-21 10:53:00 +0200 |
---|---|---|
committer | Alexander Færøy <ahf@0x90.dk> | 2014-06-21 10:53:00 +0200 |
commit | dcbcb5f04d2041a3103694344295441e0997f19f (patch) | |
tree | 55daf71ef59306bbd8359e568e93b37076b180e2 /src/irc | |
parent | 5fe144503d9a282ea66ba9962dd4e8c568dbb78c (diff) | |
parent | 70a55030d14ea2ec29fe0386872b13b7f27765f7 (diff) | |
download | irssi-dcbcb5f04d2041a3103694344295441e0997f19f.zip |
Merge pull request #50 from dajohi/cmd_null_deref
Avoid potential null dereferences.
Diffstat (limited to 'src/irc')
-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); |