Changes in boot/generic/src/payload.c [df7dc9e:b169619] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/generic/src/payload.c
rdf7dc9e rb169619 36 36 #include <gzip.h> 37 37 #include <stdbool.h> 38 #include <mem str.h>38 #include <mem.h> 39 39 #include <errno.h> 40 40 #include <str.h> … … 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.