From 108ed067e0f460515db40f147f9b872083423727 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Sat, 17 Feb 2018 16:57:12 -0600 Subject: [PATCH] vol: Blank fake linkHandles A couple of places in namei_ops.c use "fake" linkHandle FdHandle_t's. Make sure these are initialized, so we don't accidentally use uninitialized fields in the FdHandle_t. Currently, the code never uses any fields that are not explicitly set in this same code path, but this seems rather fragile, and future commits may change the fields in an FdHandle_t. Change-Id: I9372f03a4d3b68afd3ab24a27ae669cba92e0abe Reviewed-on: https://gerrit.openafs.org/14656 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- src/vol/namei_ops.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index f9dd4e5..463b66b 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -2505,6 +2505,8 @@ namei_ListAFSSubDirs(IHandle_t * dirIH, struct rx_queue resultlist; #endif + memset(&linkHandle, 0, sizeof(linkHandle)); + namei_HandleToVolDir(&name, &myIH); strlcpy(path1, name.n_path, sizeof(path1)); @@ -2779,6 +2781,8 @@ DecodeInode(char *dpath, char *name, struct ViceInodeInfo *info, char dirl; VolumeId volid = myIH->ih_vid; + memset(&linkHandle, 0, sizeof(linkHandle)); + snprintf(fpath, sizeof(fpath), "%s" OS_DIRSEP "%s", dpath, name); dirH = FindFirstFileEx(fpath, FindExInfoStandard, &data, -- 1.9.4