From e613d8991b8613e7f4081b56082bb37ff8b9a4db Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 24 Jan 2013 22:28:09 +0900 Subject: memset some of the static structures so that info doesn't get leaked to the next caller --- vxi11_server.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vxi11_server.c b/vxi11_server.c index 801e5cf..0a243b7 100644 --- a/vxi11_server.c +++ b/vxi11_server.c @@ -112,6 +112,7 @@ device_abort_1_svc(Device_Link *argp, struct svc_req *rqstp) { Create_LinkResp * create_link_1_svc(Create_LinkParms *argp, struct svc_req *rqstp) { static Create_LinkResp result; + memset(&result, 0, sizeof(result)); #ifdef DEBUG printf("create_link_1_svc()\n"); #endif @@ -221,6 +222,7 @@ device_read_1_svc(Device_ReadParms *argp, struct svc_req *rqstp) { Device_ReadStbResp * device_readstb_1_svc(Device_GenericParms *argp, struct svc_req *rqstp) { static Device_ReadStbResp result; + memset(&result, 0, sizeof(result)); #ifdef DEBUG printf("device_readstb_1_svc()\n"); #endif @@ -228,10 +230,9 @@ device_readstb_1_svc(Device_GenericParms *argp, struct svc_req *rqstp) { result.error = ERR_INVALIDLINKINDENTIFIER; else if (isLocked() && !haveLock(argp->lid) && !waitForLock(argp->flags, argp->lock_timeout)) result.error = ERR_DEVICELOCKEDBYANOTHERLINK; - else { - result.error = 0; + else result.stb = GPIB_and_VXI_get_STB(); - } + return &result; } -- cgit