commit | f9b08758e94bf269fff1285028c25f44d21bd2e7 | [log] [tgz] |
---|---|---|
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | Tue Aug 22 11:10:20 2023 +0200 |
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | Sun Aug 27 08:21:07 2023 +0200 |
tree | d85e74bf4a848f5044fd2ebed1bccb81fd7f83e2 | |
parent | 62a31e94a7b99083787e16106e022e0bb9c5f295 [diff] |
lib: parameter check in hash_calculate If hash_calculate is invoked with region_count = 0, it will try to hash INT_MAX regions. We should check this parameter. * Avoid a comparison with different signedness. * Check that region_count is at least 1. * Avoid a superfluous assignment. Fixes: b37b46f042cc ("rsa: Use checksum algorithms from struct hash_algo") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>