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 18, 2018
1 parent 16d7fef commit cea0fcd
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, sizeof password, argv[2]);
password[(sizeof password) - 1] = '\0';
} else {
#if !defined(_WIN32) || defined(__CYGWIN__)
struct termios old, new;
Expand Down

0 comments on commit cea0fcd

Please sign in to comment.