cellconfig-check-for-corrupt-keyfile-20051007 should convert at least nkeys to host byte order before checking anything - fails on little endians otherwise.

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rainer Toebbicke
European Laboratory for Particle Physics(CERN) - Geneva, Switzerland
Phone: +41 22 767 8985       Fax: +41 22 767 7155
--- openafs/src/auth/cellconfig.c.o141  2005-10-15 16:55:39.000000000 +0200
+++ openafs/src/auth/cellconfig.c       2005-11-07 14:49:00.000000000 +0100
@@ -1125,14 +1125,14 @@
        return 0;
     }
 
+    /* convert key structure to host order */
+    tstr->nkeys = ntohl(tstr->nkeys);
     if (code < sizeof(afs_int32) + (tstr->nkeys*sizeof(struct afsconf_key))) {
        tstr->nkeys = 0;
        UNLOCK_GLOBAL_MUTEX;
        return 0;
     }
 
-    /* convert key structure to host order */
-    tstr->nkeys = ntohl(tstr->nkeys);
     for (fd = 0; fd < tstr->nkeys; fd++)
        tstr->key[fd].kvno = ntohl(tstr->key[fd].kvno);
 

Reply via email to