X-Git-Url: https://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_crypt.c;h=d70d79306756320cb57971e93ee7c13c82e2c671;hb=8be3b458d02c53b1bf3489b408910ac6ae84273d;hp=988afd803159407075ac97c77bcc86fa3bd1fdbd;hpb=531e9472326bf2212e5cf2a0db00cdfc638846d0;p=openssl-gost%2Fengine.git diff --git a/gost_crypt.c b/gost_crypt.c index 988afd8..d70d793 100644 --- a/gost_crypt.c +++ b/gost_crypt.c @@ -765,7 +765,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 */ @@ -826,7 +826,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 */