1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Fix segfault in /cmd exec

Test for correct number of arguments before using argument.
This commit is contained in:
Michael Vetter 2019-07-12 10:36:17 +02:00
parent ad41959cc6
commit 04988ab4ba

View File

@ -7818,6 +7818,11 @@ cmd_command_exec(ProfWin *window, const char *const command, gchar **args)
return TRUE; return TRUE;
} }
if (args[1] == NULL) {
cons_bad_cmd_usage(command);
return TRUE;
}
char *jid = args[2]; char *jid = args[2];
if (jid == NULL) { if (jid == NULL) {
switch (window->type) { switch (window->type) {