kauth: Don't ignore GetExtendedCellInfo failures
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 22 Feb 2013 09:51:24 +0000 (09:51 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 24 Feb 2013 19:07:37 +0000 (11:07 -0800)
Don't ignore a failure from afsconf_GetExtendedCellInfo, as it will
leave buffers that we later read uninitialised.

Caught by clang-analyzer

Change-Id: Ia0c2675a3083385d011fd340f36bf13373f89feb
Reviewed-on: http://gerrit.openafs.org/9180
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/kauth/kaserver.c

index 108bfa9..2fca96a 100644 (file)
@@ -328,9 +328,13 @@ main(int argc, char *argv[])
            "Migrating to a Kerberos 5 KDC is advised.  "
            "http://www.openafs.org/no-more-des.html\n"));
 
-    code =
-       afsconf_GetExtendedCellInfo(KA_conf, cell, AFSCONF_KAUTHSERVICE,
-                                   &cellinfo, clones);
+    code = afsconf_GetExtendedCellInfo(KA_conf, cell, AFSCONF_KAUTHSERVICE,
+                                      &cellinfo, clones);
+    if (code) {
+       afs_com_err(whoami, code, "Couldn't read cell configuration");
+       exit(1);
+    }
+
     if (servers) {
        if ((code = ubik_ParseServerList(argc, argv, &myHost, serverList))) {
            afs_com_err(whoami, code, "Couldn't parse server list");