X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_crypt.c;fp=gost_crypt.c;h=3af9abe05ac690e84a3d8f27a1183b163ac108e4;hb=fbd7748fde5397eb39e398f06ee31c1827e68201;hp=e9f311eb35c411adc6ccf154c34be3b3b00b2071;hpb=672ef82b66374cde3b74140a9b78891cda451fac;p=openssl-gost%2Fengine.git diff --git a/gost_crypt.c b/gost_crypt.c index e9f311e..3af9abe 100644 --- a/gost_crypt.c +++ b/gost_crypt.c @@ -762,7 +762,7 @@ 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 */ @@ -823,7 +823,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 */