mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-21 15:36:33 -05:00
Change the BLOCK_HASH_SIZE type to avoid potential overflow
This commit is contained in:
parent
6b9459346a
commit
fd77444254
7 changed files with 13 additions and 12 deletions
|
|
@ -138,7 +138,7 @@ struct snapraid_filter {
|
|||
*
|
||||
* At max HASH_MAX.
|
||||
*/
|
||||
extern int BLOCK_HASH_SIZE;
|
||||
extern size_t BLOCK_HASH_SIZE;
|
||||
|
||||
/**
|
||||
* Block of a file.
|
||||
|
|
@ -646,7 +646,7 @@ int filter_content(tommy_list* contentlist, const char* path);
|
|||
*/
|
||||
static inline int hash_is_invalid(const unsigned char* hash)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
/* if the hash is reduced, we cannot grant that it's a specific kind of hash */
|
||||
if (BLOCK_HASH_SIZE != HASH_MAX)
|
||||
|
|
@ -668,7 +668,7 @@ static inline int hash_is_invalid(const unsigned char* hash)
|
|||
*/
|
||||
static inline int hash_is_zero(const unsigned char* hash)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
/* if the hash is reduced, we cannot grant that it's a specific kind of hash */
|
||||
if (BLOCK_HASH_SIZE != HASH_MAX)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue