Replace int -> uint to avoid signed integer overflow

An example of such an error (should be compiled with DEBUG_SANITIZE):

runtime error: left shift of 1 by 31 places cannot be represented in
type 'int'

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Rostislav Skudnov
2017-02-01 18:35:13 +00:00
committed by Denys Vlasenko
parent c31b54fd81
commit 8762512fdb
5 changed files with 8 additions and 8 deletions

View File

@@ -24,7 +24,7 @@ uint32_t* FAST_FUNC crc32_filltable(uint32_t *crc_table, int endian)
{
uint32_t polynomial = endian ? 0x04c11db7 : 0xedb88320;
uint32_t c;
int i, j;
unsigned i, j;
if (!crc_table)
crc_table = xmalloc(256 * sizeof(uint32_t));