diff options
author | Ted Gould <ted@gould.cx> | 2012-08-30 12:01:14 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-08-30 12:01:14 -0500 |
commit | e02bb24b04e4771ecdfdbe12fe474f886882e66f (patch) | |
tree | baa1e7e0bc137f95c86b2039e99fa655ca956300 /src | |
parent | 5d0541a98e4485c6d28480088f449261d9cd68aa (diff) | |
download | libpam-x2go-e02bb24b04e4771ecdfdbe12fe474f886882e66f.tar.gz libpam-x2go-e02bb24b04e4771ecdfdbe12fe474f886882e66f.tar.bz2 libpam-x2go-e02bb24b04e4771ecdfdbe12fe474f886882e66f.zip |
Make sure to lock the password buffer
Diffstat (limited to 'src')
-rw-r--r-- | src/freerdp-auth-check.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/freerdp-auth-check.c b/src/freerdp-auth-check.c index d50833b..178db98 100644 --- a/src/freerdp-auth-check.c +++ b/src/freerdp-auth-check.c @@ -60,6 +60,10 @@ main (int argc, char * argv[]) return -1; } + if (mlock(password, sizeof(password)) != 0) { + return -1; + } + freerdp_channels_global_init(); freerdp * instance = freerdp_new(); @@ -88,10 +92,14 @@ main (int argc, char * argv[]) instance->settings->port = strtoul(colonloc, NULL, 10); } + int retval = -1; if (freerdp_connect(instance)) { freerdp_disconnect(instance); - return 0; - } else { - return -1; + retval = 0; } + + memset(password, 0, sizeof(password)); + munlock(password, sizeof(password)); + + return retval; } |