1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04:00

Avoid potential null dereferences.

This commit is contained in:
David Hill 2014-06-19 09:56:57 -04:00
parent 9d0d4d9437
commit 70a55030d1

View File

@ -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);