mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-03-13 06:48:13 +08:00
occtl: avoid crash on empty cmdline argument
This commit is contained in:
@@ -121,7 +121,7 @@ unsigned need_help(const char *arg)
|
|||||||
unsigned check_cmd_help(const char *line)
|
unsigned check_cmd_help(const char *line)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned len = strlen(line);
|
unsigned len = (line!=NULL)?strlen(line):0;
|
||||||
unsigned status = 0, tlen;
|
unsigned status = 0, tlen;
|
||||||
|
|
||||||
while (len > 0 && (line[len - 1] == '?' || whitespace(line[len - 1])))
|
while (len > 0 && (line[len - 1] == '?' || whitespace(line[len - 1])))
|
||||||
|
|||||||
Reference in New Issue
Block a user