Also loop when decrypting AES data and UINT_MAX is small.
diff --git a/lib/zip_source_winzip_aes_decode.c b/lib/zip_source_winzip_aes_decode.c index 5f21920..9c8cc3f 100644 --- a/lib/zip_source_winzip_aes_decode.c +++ b/lib/zip_source_winzip_aes_decode.c
@@ -176,6 +176,7 @@ { struct winzip_aes *ctx; zip_int64_t n; + zip_uint64_t total, offset; ctx = (struct winzip_aes *)ud; @@ -205,8 +206,10 @@ } ctx->current_position += n; - /* TODO: loop if len > UINT_MAX */ - _zip_fcrypt_decrypt(data, n, &ctx->fcrypt_ctx); + total = (zip_uint64_t)n; + for (offset = 0; offset < total; offset += ZIP_MIN(total - offset, UINT_MAX)) { + _zip_fcrypt_decrypt(data + offset, ZIP_MIN(total - offset, UINT_MAX), &ctx->fcrypt_ctx); + } return n;