summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <tpearson@raptorengineering.com>2019-03-03 19:47:02 -0600
committerTimothy Pearson <tpearson@raptorengineering.com>2019-03-17 00:34:03 -0500
commit31a76fc0c0585fb4d9fefd5bdc771caff8cc21dc (patch)
tree3c9784c70e675183b123a95b2ed53b643969a459
parent0e1490480e91d196896cfbaef32d224c28763efd (diff)
downloadxrdp-proprietary-31a76fc0c0585fb4d9fefd5bdc771caff8cc21dc.tar.gz
xrdp-proprietary-31a76fc0c0585fb4d9fefd5bdc771caff8cc21dc.zip
Fix a few situations where process output was corrupted with existing uncleard buffer data
This fixes session termination not being marked in the database
-rw-r--r--raptorsmiface/libraptorsmiface.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/raptorsmiface/libraptorsmiface.c b/raptorsmiface/libraptorsmiface.c
index d12dffb2..909a27b1 100644
--- a/raptorsmiface/libraptorsmiface.c
+++ b/raptorsmiface/libraptorsmiface.c
@@ -279,6 +279,7 @@ char raptor_sm_deallocate_session(char* username) {
asprintf(&command_string, "ssh root@%s \'ps -p %d | grep %d\'", ip, serverpid, serverpid);
FILE *fp;
char output[1024];
+ memset(output, 0, sizeof(output));
// Open the command for reading
fp = popen(command_string, "r");
if (fp == NULL) {
@@ -764,6 +765,7 @@ pid_t raptor_sm_run_remote_server(char* username, char *const argv[], char* dbfi
asprintf(&command_string, "ssh root@%s \'ps -p %d | grep %d\'", ip, ret, ret);
FILE *fp;
char output[1024];
+ memset(output, 0, sizeof(output));
// Open the command for reading
fp = popen(command_string, "r");
if (fp == NULL) {
@@ -834,6 +836,7 @@ pid_t raptor_sm_run_remote_server(char* username, char *const argv[], char* dbfi
FILE *fp;
char output[1024];
+ memset(output, 0, sizeof(output));
// Open the command for reading
fp = popen(command_string, "r");