Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1 | From 77ff5f1be394eb2c786df561ff37dde7f982ec76 Mon Sep 17 00:00:00 2001 |
| 2 | From: Stefano Babic <sbabic@denx.de> |
| 3 | Date: Fri, 28 Jul 2017 13:20:52 +0200 |
| 4 | Subject: [PATCH] Wrong CRC with ASCII CRC for large files |
| 5 | |
| 6 | Due to signedness, the checksum is not computed when filesize is bigger |
| 7 | a 2GB. |
| 8 | |
| 9 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bug-cpio/2017-07/msg00004.html] |
| 10 | Signed-off-by: Stefano Babic <sbabic@denx.de> |
| 11 | --- |
| 12 | src/copyout.c | 8 ++++---- |
| 13 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 14 | |
| 15 | diff --git a/src/copyout.c b/src/copyout.c |
| 16 | index 1f0987a..727aeca 100644 |
| 17 | --- a/src/copyout.c |
| 18 | +++ b/src/copyout.c |
| 19 | @@ -34,13 +34,13 @@ |
| 20 | compute and return a checksum for them. */ |
| 21 | |
| 22 | static uint32_t |
| 23 | -read_for_checksum (int in_file_des, int file_size, char *file_name) |
| 24 | +read_for_checksum (int in_file_des, unsigned int file_size, char *file_name) |
| 25 | { |
| 26 | uint32_t crc; |
| 27 | char buf[BUFSIZ]; |
| 28 | - int bytes_left; |
| 29 | - int bytes_read; |
| 30 | - int i; |
| 31 | + unsigned int bytes_left; |
| 32 | + unsigned int bytes_read; |
| 33 | + unsigned int i; |
| 34 | |
| 35 | crc = 0; |
| 36 | |
| 37 | -- |
| 38 | 2.7.4 |
| 39 | |