summaryrefslogtreecommitdiff
path: root/vxi11_server.c
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-24 22:28:09 +0900
committerdaniel <danieruru@gmail.com>2013-01-24 22:28:09 +0900
commite613d8991b8613e7f4081b56082bb37ff8b9a4db (patch)
tree90d9b8dd614b665fa0c48233b65c2fbeea306149 /vxi11_server.c
parente8ff8484ddc1899807fce40a4f54c876a9dfbc7f (diff)
memset some of the static structures so that info doesn't get leaked to the next caller
Diffstat (limited to 'vxi11_server.c')
-rw-r--r--vxi11_server.c7
1 files 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;
}