Skip to content

Commit

Permalink
Fix use of unitialized memory in gets_quiet
Browse files Browse the repository at this point in the history
Spotted by cppcheck

Signed-off-by: Riccardo Magliocchetti <[email protected]>
  • Loading branch information
xrmx authored and ralight committed May 5, 2017
1 parent 3c8581a commit 059ba5f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mosquitto_passwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ int gets_quiet(char *s, int len)
memset(s, 0, len);
h = GetStdHandle(STD_INPUT_HANDLE);
GetConsoleMode(h, &con_orig);
con_quiet = con_orig;
con_quiet &= ~ENABLE_ECHO_INPUT;
con_quiet |= ENABLE_LINE_INPUT;
SetConsoleMode(h, con_quiet);
Expand Down

0 comments on commit 059ba5f

Please sign in to comment.