Commit
981bc005f8161ca9ee52ea281c7d73e0e4e2461a refactored PNewStatMount
and PFlushMount by moving their common logic to a new function
afs_LookupName(). In this function, the output parameters are zeroed.
However, this is done before checking that their pointers are valid.
Add additional checks before memset().
Change-Id: I134550d5f9b6d5a9aa5c360e260335d2efce884a
Reviewed-on: https://gerrit.openafs.org/15283
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
struct dcache *tdc;
afs_size_t offset, len;
- memset(asys, 0, sizeof(*asys));
- memset(afid, 0, sizeof(*afid));
+ /* do not leave garbage in the output parameters in error cases */
+ if (asys != NULL)
+ memset(asys, 0, sizeof(*asys));
+ if (afid != NULL)
+ memset(afid, 0, sizeof(*afid));
if (!avc || !areq || !aname || !asys || !afid) {
afs_warn("afs: Internal error, bad args to afs_LookupName: %p, %p, %p, "