telnet: Fix crash on 'help help' command.

Reported by AiDai in
<https://lists.gnu.org/archive/html/bug-inetutils/2021-12/msg00009.html>
and debugged and tiny patch by Erik Auerswald in
<https://lists.gnu.org/archive/html/bug-inetutils/2022-02/msg00009.html>.

* telnet/commands.c (help): Don't crash on empty c->help.
This commit is contained in:
Simon Josefsson
2022-07-07 22:47:55 +02:00
parent 0e5767771a
commit fe1c596e02

View File

@@ -3097,7 +3097,7 @@ help (int argc, char *argv[])
printf ("?Ambiguous help command %s\n", arg);
else if (c == (Command *) 0)
printf ("?Invalid help command %s\n", arg);
else
else if (c->help)
printf ("%s\n", c->help);
}
return 0;