diff options
author | Rostislav Skudnov <rostislav@tuxera.com> | 2017-02-01 18:35:13 +0000 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-02-04 23:10:22 +0100 |
commit | 8762512fdb088acefb9f3ea5f7b1e1bf2d336ff3 (patch) | |
tree | 309e04746b4bcb6f2ad645b29f7fcecfbff339e5 /libbb/crc32.c | |
parent | c31b54fd81690b3df3898437f5865674d06e6577 (diff) | |
download | busybox-w32-8762512fdb088acefb9f3ea5f7b1e1bf2d336ff3.tar.gz busybox-w32-8762512fdb088acefb9f3ea5f7b1e1bf2d336ff3.tar.bz2 busybox-w32-8762512fdb088acefb9f3ea5f7b1e1bf2d336ff3.zip |
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>
Diffstat (limited to 'libbb/crc32.c')
-rw-r--r-- | libbb/crc32.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/crc32.c b/libbb/crc32.c index ac9836cc9..0711ca84e 100644 --- a/libbb/crc32.c +++ b/libbb/crc32.c | |||
@@ -24,7 +24,7 @@ uint32_t* FAST_FUNC crc32_filltable(uint32_t *crc_table, int endian) | |||
24 | { | 24 | { |
25 | uint32_t polynomial = endian ? 0x04c11db7 : 0xedb88320; | 25 | uint32_t polynomial = endian ? 0x04c11db7 : 0xedb88320; |
26 | uint32_t c; | 26 | uint32_t c; |
27 | int i, j; | 27 | unsigned i, j; |
28 | 28 | ||
29 | if (!crc_table) | 29 | if (!crc_table) |
30 | crc_table = xmalloc(256 * sizeof(uint32_t)); | 30 | crc_table = xmalloc(256 * sizeof(uint32_t)); |