kauth: Move COUNT_REQ to beginning of block 15/13815/3
authorAndrew Deason <adeason@sinenomine.net>
Mon, 26 Aug 2019 21:08:31 +0000 (16:08 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 28 Aug 2019 06:53:07 +0000 (02:53 -0400)
Commit b604ee7a (OPENAFS-SA-2018-002 kaserver: prevent KAM_ListEntry
information leak) added a memset in kamListEntry before COUNT_REQ, but
COUNT_REQ declares a local variable. This breaks the WINNT build,
because we must declare variables at the beginning of a block.

To fix this, just swap the two lines.

Change-Id: I47eb61e6f95c2e38c619e90c8f093de325892c63
Reviewed-on: https://gerrit.openafs.org/13815
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>

src/kauth/kaprocs.c

index ded2d96..f7c639e 100644 (file)
@@ -1691,8 +1691,8 @@ kamListEntry(struct rx_call *call,
     afs_int32 caller;
     struct kaentry tentry;
 
-    memset(name, 0, sizeof(*name));
     COUNT_REQ(ListEntry);
+    memset(name, 0, sizeof(*name));
     if ((code = InitAuthServ(&tt, LOCKREAD, this_op)))
        return code;
     code = check_auth(call, tt, 1, &caller);