Line 0
Link Here
|
|
|
1 |
--- libarchive/archive_read_support_format_cpio.c.orig 2013-01-14 01:43:45 UTC |
2 |
+++ libarchive/archive_read_support_format_cpio.c |
3 |
@@ -198,7 +198,7 @@ static int archive_read_format_cpio_read |
4 |
static int archive_read_format_cpio_read_header(struct archive_read *, |
5 |
struct archive_entry *); |
6 |
static int archive_read_format_cpio_skip(struct archive_read *); |
7 |
-static int be4(const unsigned char *); |
8 |
+static int64_t be4(const unsigned char *); |
9 |
static int find_odc_header(struct archive_read *); |
10 |
static int find_newc_header(struct archive_read *); |
11 |
static int header_bin_be(struct archive_read *, struct cpio *, |
12 |
@@ -213,7 +213,7 @@ static int header_afiol(struct archive_r |
13 |
struct archive_entry *, size_t *, size_t *); |
14 |
static int is_octal(const char *, size_t); |
15 |
static int is_hex(const char *, size_t); |
16 |
-static int le4(const unsigned char *); |
17 |
+static int64_t le4(const unsigned char *); |
18 |
static int record_hardlink(struct archive_read *a, |
19 |
struct cpio *cpio, struct archive_entry *entry); |
20 |
|
21 |
@@ -944,17 +944,17 @@ archive_read_format_cpio_cleanup(struct |
22 |
return (ARCHIVE_OK); |
23 |
} |
24 |
|
25 |
-static int |
26 |
+static int64_t |
27 |
le4(const unsigned char *p) |
28 |
{ |
29 |
- return ((p[0]<<16) + (p[1]<<24) + (p[2]<<0) + (p[3]<<8)); |
30 |
+ return ((p[0] << 16) + (((int64_t)p[1]) << 24) + (p[2] << 0) + (p[3] << 8)); |
31 |
} |
32 |
|
33 |
|
34 |
-static int |
35 |
+static int64_t |
36 |
be4(const unsigned char *p) |
37 |
{ |
38 |
- return ((p[0]<<24) + (p[1]<<16) + (p[2]<<8) + (p[3])); |
39 |
+ return ((((int64_t)p[0]) << 24) + (p[1] << 16) + (p[2] << 8) + (p[3])); |
40 |
} |
41 |
|
42 |
/* |