Skip to content

Commit

Permalink
fixed CID 273061 (#1 of 1): Copy into fixed size buffer (STRING_OVERF…
Browse files Browse the repository at this point in the history
…LOW)
  • Loading branch information
frankmorgner committed Apr 23, 2018
1 parent 951466a commit 881c236
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ int main(int argc, char *argv[])

/* get password */
if (argc > 2) {
strcpy(password, argv[2]);
strncpy(password, argv[2], sizeof password);
password[(sizeof password) - 1] = '\0';
} else {
#if !defined(_WIN32) || defined(__CYGWIN__)
struct termios old, new;
Expand Down

0 comments on commit 881c236

Please sign in to comment.