vlserver: Use correct memsets in vlentry convertor

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>
This commit is contained in:
Simon Wilkinson 2011-05-19 18:56:27 +01:00 committed by Derrick Brashear
parent 41dc2509ba
commit 90507fcb10

View File

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