aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-08-30 12:01:14 -0500
committerTed Gould <ted@gould.cx>2012-08-30 12:01:14 -0500
commite02bb24b04e4771ecdfdbe12fe474f886882e66f (patch)
treebaa1e7e0bc137f95c86b2039e99fa655ca956300 /src
parent5d0541a98e4485c6d28480088f449261d9cd68aa (diff)
downloadlibpam-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.c14
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;
}