]> Zhao Yanbai Git Server - minix.git/commitdiff
random: resolve Coverity warnings
authorDavid van Moolenbroek <david@minix3.org>
Mon, 13 Aug 2012 16:23:48 +0000 (16:23 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Tue, 14 Aug 2012 09:11:16 +0000 (09:11 +0000)
drivers/random/aes/rijndael_api.c

index 5a1a4a81c301be169be31a683df7a712bfb58818..9a564001aa7fbafee7cd6e936d0136991a01aa6b 100644 (file)
@@ -92,7 +92,8 @@ int rijndael_makekey(rd_keyinstance *key,
            else break;
 
            if (keylen >= 256/8) return RD_BAD_KEY_MAT;
-           B(k)[keylen++] = b;
+           k[keylen/4][keylen%4] = b;
+           keylen++;
        }
        if (c != 0) return RD_BAD_KEY_MAT;