kauth: realm can't be NULL when calling CellToRealm
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 19 Feb 2013 15:25:12 +0000 (15:25 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 24 Feb 2013 19:48:58 +0000 (11:48 -0800)
Despite what the static analyzer thinks, ka_CellToRealm can't be
called with a NULL realm. Just add an assert to close down that
code path, and stop it from producing an error.

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

src/kauth/kalocalcell.c

index c152db7..9d03b3a 100644 (file)
@@ -131,6 +131,8 @@ ka_CellToRealm(char *cell, char *realm, int *local)
 {
     int code = 0;
 
+    opr_Assert(realm != NULL);
+
     LOCK_GLOBAL_MUTEX;
     code = ka_ExpandCell(cell, realm, local);
     ucstring(realm, realm, MAXKTCREALMLEN);