diff options
author | Tobias Brunner <tobias@strongswan.org> | 2014-07-02 11:49:34 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2014-07-02 12:38:44 +0200 |
commit | 0a26f39a71fe431b301b482d026c34b59577b91d (patch) | |
tree | 5323dea299aa9d38f2ae499936c3ef5d6fa191a1 /src | |
parent | 32a262e7a140cb43e83276827fd3e10964503969 (diff) | |
download | strongswan-0a26f39a71fe431b301b482d026c34b59577b91d.tar.bz2 strongswan-0a26f39a71fe431b301b482d026c34b59577b91d.tar.xz |
windows: Make sure the string returned from ReadConsole() is null terminated
Diffstat (limited to 'src')
-rw-r--r-- | src/libstrongswan/utils/windows.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstrongswan/utils/windows.c b/src/libstrongswan/utils/windows.c index 397f3b156..2168d6440 100644 --- a/src/libstrongswan/utils/windows.c +++ b/src/libstrongswan/utils/windows.c @@ -291,6 +291,8 @@ char* getpass(const char *prompt) SetConsoleMode(in, mode); return NULL; } + buf[sizeof(buf)-1] = '\0'; + if (done) { pos = strchr(buf, '\r'); |