diff options
| author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2018-11-07 19:12:29 +0200 |
|---|---|---|
| committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2018-11-07 19:12:29 +0200 |
| commit | 3f76319803a4abcd33fa29a0ac39f8ed9d646226 (patch) | |
| tree | 9934355bfddac234c5eb560643c3fef0bbec7ffe /cipher | |
| parent | 9d6431604b5ee21572c1c2cfa8376e6d81162cbb (diff) | |
| download | libgcrypt-3f76319803a4abcd33fa29a0ac39f8ed9d646226.tar.gz | |
Fix 'variable may be used uninitialized' warning for CTR mode
* cipher/cipher-ctr.c (_gcry_cipher_ctr_encrypt): Set N to BLOCKSIZE
before counter loop.
--
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher')
| -rw-r--r-- | cipher/cipher-ctr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cipher/cipher-ctr.c b/cipher/cipher-ctr.c index 2df0b8c3..546d4f8e 100644 --- a/cipher/cipher-ctr.c +++ b/cipher/cipher-ctr.c @@ -77,6 +77,7 @@ _gcry_cipher_ctr_encrypt (gcry_cipher_hd_t c, { unsigned char tmp[MAX_BLOCKSIZE]; + n = blocksize; do { nburn = enc_fn (&c->context.c, tmp, c->u_ctr.ctr); @@ -91,7 +92,6 @@ _gcry_cipher_ctr_encrypt (gcry_cipher_hd_t c, if (inbuflen < blocksize) break; - n = blocksize; cipher_block_xor(outbuf, inbuf, tmp, blocksize); inbuflen -= n; |
