vlserver: Use correct memsets in vlentry convertor
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 19 May 2011 17:56:27 +0000 (18:56 +0100)
committerDerrick Brashear <shadow@dementia.org>
Sun, 5 Jun 2011 14:00:32 +0000 (07:00 -0700)
The various vlentry_to_<blah> conversion functions have obviously
been copy and pasted from each other. However, the size of the
structure which is being zeroed has not been updated when we are
zeroing different structures. Fix this, so that we always clear all
of the structure that we are filling.

Change-Id: Ic822e1d2b17494574074c332c7680e94d4701c66
Reviewed-on: http://gerrit.openafs.org/4773
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/vlserver/vlprocs.c

index 9741964..19186c9 100644 (file)
@@ -3060,7 +3060,7 @@ vlentry_to_nvldbentry(struct vl_ctx *ctx, struct nvlentry *VlEntry,
 {
     int i, j;
 
-    memset(VldbEntry, 0, sizeof(struct vldbentry));
+    memset(VldbEntry, 0, sizeof(struct nvldbentry));
     strncpy(VldbEntry->name, VlEntry->name, sizeof(VldbEntry->name));
     for (i = 0; i < NMAXNSERVERS; i++) {
        if (VlEntry->serverNumber[i] == BADSERVERID)
@@ -3099,7 +3099,7 @@ vlentry_to_uvldbentry(struct vl_ctx *ctx, struct nvlentry *VlEntry,
 {
     int i, j;
 
-    memset(VldbEntry, 0, sizeof(struct vldbentry));
+    memset(VldbEntry, 0, sizeof(struct uvldbentry));
     strncpy(VldbEntry->name, VlEntry->name, sizeof(VldbEntry->name));
     for (i = 0; i < NMAXNSERVERS; i++) {
        if (VlEntry->serverNumber[i] == BADSERVERID)