X-Git-Url: http://www.wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_crypt.c;h=3cbea7620c776c7b8954bdf05882615e1354f383;hb=711b83cba2fb9d5615e83ce17ccd1fbd66d4b9db;hp=f60dd0629c763239ef2e49cf113a9977ec094b7f;hpb=2dd3a2f2e9a6286fab4dd80f7f127ce8289bc77e;p=openssl-gost%2Fengine.git diff --git a/gost_crypt.c b/gost_crypt.c index f60dd06..3cbea76 100644 --- a/gost_crypt.c +++ b/gost_crypt.c @@ -767,7 +767,7 @@ static int gost_cipher_do_cfb(EVP_CIPHER_CTX *ctx, unsigned char *out, } } - for (; i + 8 < inl; i += 8, in_ptr += 8, out_ptr += 8) { + for (; (inl - i) >= 8; i += 8, in_ptr += 8, out_ptr += 8) { /* * block cipher current iv */ @@ -828,7 +828,7 @@ static int gost_cipher_do_cnt(EVP_CIPHER_CTX *ctx, unsigned char *out, } } - for (; i + 8 < inl; i += 8, in_ptr += 8, out_ptr += 8) { + for (; (inl - i) >= 8; i += 8, in_ptr += 8, out_ptr += 8) { /* * block cipher current iv */