From: Steve Dickson Date: Tue, 13 Dec 2011 19:49:00 +0000 (-0500) Subject: nfsidmap: Stack variable not being initialized. X-Git-Tag: nfs-utils-1-2-6-rc4 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=b4901af20f67730cc63e38dcfd70d66c8ccd677b;p=nfs-utils.git nfsidmap: Stack variable not being initialized. The 'clearing' variable was not being initialized to zero which was cause the default key ring to always be cleared. Signed-off-by: Steve Dickson --- diff --git a/utils/nfsidmap/nfsidmap.c b/utils/nfsidmap/nfsidmap.c index c6b730b..ce8cf3e 100644 --- a/utils/nfsidmap/nfsidmap.c +++ b/utils/nfsidmap/nfsidmap.c @@ -211,7 +211,7 @@ int main(int argc, char **argv) int timeout = 600; key_serial_t key; char *progname, *keystr = NULL; - int clearring, keymask = 0; + int clearing = 0, keymask = 0; /* Set the basename */ if ((progname = strrchr(argv[0], '/')) != NULL) @@ -236,7 +236,7 @@ int main(int argc, char **argv) keystr = strdup(optarg); break; case 'c': - clearring++; + clearing++; break; case 'v': verbose++; @@ -254,7 +254,7 @@ int main(int argc, char **argv) rc = key_revoke(keystr, keymask); return rc; } - if (clearring) { + if (clearing) { rc = keyring_clear(DEFAULT_KEYRING); return rc; }