diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-02-22 11:55:30 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-02-22 11:55:30 -0600 |
commit | 58ea3329871c74856d7572a2a2e67aab27fcce20 (patch) | |
tree | f800cb7081a5bafc674a542610a363e9fc3872cb | |
parent | 93b6dd865cd9779c2bdc199145c9c6315baac712 (diff) | |
download | nuttx-58ea3329871c74856d7572a2a2e67aab27fcce20.tar.gz nuttx-58ea3329871c74856d7572a2a2e67aab27fcce20.tar.bz2 nuttx-58ea3329871c74856d7572a2a2e67aab27fcce20.zip |
For Telnetd password/username fixes from Bertikd Van den Bergh
-rw-r--r-- | apps/nshlib/nsh_telnetd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/nshlib/nsh_telnetd.c b/apps/nshlib/nsh_telnetd.c index b3e67b87c..9e712cc7b 100644 --- a/apps/nshlib/nsh_telnetd.c +++ b/apps/nshlib/nsh_telnetd.c @@ -132,7 +132,7 @@ int nsh_telnetlogin(struct console_stdio_s *pstate) if (fgets(pstate->cn_line, CONFIG_NSH_LINELEN, INSTREAM(pstate)) != NULL) { strncpy(username, pstate->cn_line, sizeof(username)); - username[strlen(pstate->cn_line) - 1] = 0; + username[sizeof(username) - 1] = 0; } /* Ask for the login password */ @@ -145,7 +145,7 @@ int nsh_telnetlogin(struct console_stdio_s *pstate) /* Verify the username and password */ strncpy(password, pstate->cn_line, sizeof(password)); - password[strlen(pstate->cn_line) - 1] = 0; + password[sizeof(password) - 1] = 0; if (strcmp(password, CONFIG_NSH_TELNET_PASSWORD) == 0 && strcmp(username, CONFIG_NSH_TELNET_USERNAME) == 0) |