Changeset d091007 in mainline for boot/generic/src/payload.c
- Timestamp:
- 2021-06-04T16:58:15Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3c8c580
- Parents:
- da15002
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/generic/src/payload.c
rda15002 rd091007 61 61 { 62 62 char *e = (char *) ext(s); 63 if ( e != NULL && str_cmp(e, ".gz") == 0)63 if ((e != NULL) && (str_cmp(e, ".gz") == 0)) 64 64 *e = '\0'; 65 }66 67 static bool isgzip(const char *s)68 {69 const char *e = ext(s);70 return e != NULL && str_cmp(e, ".gz") == 0;71 65 } 72 66 … … 82 76 { 83 77 const char *name; 84 const uint8_t *data;85 78 size_t packed_size; 86 size_t unpacked_size;87 79 88 80 if (!tar_info(*cstart, cend, &name, &packed_size)) 89 81 return false; 90 82 91 data = *cstart + TAR_BLOCK_SIZE;83 const uint8_t *data = *cstart + TAR_BLOCK_SIZE; 92 84 *cstart += TAR_BLOCK_SIZE + ALIGN_UP(packed_size, TAR_BLOCK_SIZE); 93 85 94 bool gz = isgzip(name); 95 96 unpacked_size = gz ? gzip_size(data, packed_size) : packed_size; 86 bool gz = gzip_check(data, packed_size); 87 size_t unpacked_size = gz ? gzip_size(data, packed_size) : packed_size; 97 88 98 89 /* Components must be page-aligned. */ … … 156 147 while (tar_info(start, payload_end, &name, &packed_size)) { 157 148 sz = ALIGN_UP(sz, PAGE_SIZE); 158 if ( isgzip(name))149 if (gzip_check(start + TAR_BLOCK_SIZE, packed_size)) 159 150 sz += gzip_size(start + TAR_BLOCK_SIZE, packed_size); 160 151 else
Note:
See TracChangeset
for help on using the changeset viewer.