diff options
-rw-r--r-- | sys/crypto/rijndael/rijndael-api-fst.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/crypto/rijndael/rijndael-api-fst.c b/sys/crypto/rijndael/rijndael-api-fst.c index d22c06e..2b8c8f1 100644 --- a/sys/crypto/rijndael/rijndael-api-fst.c +++ b/sys/crypto/rijndael/rijndael-api-fst.c @@ -225,7 +225,7 @@ int rijndael_padEncrypt(cipherInstance *cipher, keyInstance *key, outBuffer += 16; } padLen = 16 - (inputOctets - 16*numBlocks); - if (padLen > 0 && padLen <= 16) + if (padLen <= 0 || padLen > 16) return BAD_CIPHER_STATE; bcopy(input, block, 16 - padLen); for (cp = block + 16 - padLen; cp < block + 16; cp++) |