Skip to content
Snippets Groups Projects
Commit dd9ee3f4 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Bug#716683 "Admin console hangs on unknown command"

Review fixes: the original patch is fine,
but since we use strlen() for help, let's use strlen() for
unknown_command too.
parent d3ab130e
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ static const char *help = ...@@ -58,7 +58,7 @@ static const char *help =
" - reload configuration" CRLF; " - reload configuration" CRLF;
static const char unknown_command[] = "unknown command. try typing help." CRLF; static const char *unknown_command = "unknown command. try typing help." CRLF;
#line 65 "core/admin.c" #line 65 "core/admin.c"
...@@ -1457,7 +1457,7 @@ case 107: ...@@ -1457,7 +1457,7 @@ case 107:
if (p != pe) { if (p != pe) {
start(out); start(out);
tbuf_append(out, unknown_command, sizeof(unknown_command) - 1); tbuf_append(out, unknown_command, strlen(unknown_command));
end(out); end(out);
} }
......
...@@ -56,7 +56,7 @@ static const char *help = ...@@ -56,7 +56,7 @@ static const char *help =
" - reload configuration" CRLF; " - reload configuration" CRLF;
static const char unknown_command[] = "unknown command. try typing help." CRLF; static const char *unknown_command = "unknown command. try typing help." CRLF;
%%{ %%{
machine admin; machine admin;
...@@ -203,7 +203,7 @@ admin_dispatch(void) ...@@ -203,7 +203,7 @@ admin_dispatch(void)
if (p != pe) { if (p != pe) {
start(out); start(out);
tbuf_append(out, unknown_command, sizeof(unknown_command) - 1); tbuf_append(out, unknown_command, strlen(unknown_command));
end(out); end(out);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment