| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This way we can keep the input images const when calling
genetatepatches().
Test: recovery component test; diff and patch on chrome.apk; generate
recovery-from-boot.p for angler.
Change-Id: I65b5689b88f6719c6ede46bb82def0c4caeb8a61
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This helps us to add a new mode to handle large APKs in the follow
up CL.
Changes include:
1. Create a new interface class 'Image'
1. Create subclasses 'ZipModeImage' and 'ImageModeImage' and move the
related functions there.
Bug: 63542719
Test: recovery_component_test passes
Change-Id: I7729b0ba39b19a9c84811636a60dd0a0b1acc2f0
|
|
|
|
|
|
|
|
|
|
|
| |
In a rare case, a random chunk will pass both the gzip header check
and the inflation process; but fail the uncompressed length check in the
footer. This leads to a imgdiff failure. So, we should treat this chunk
as 'normal' instead of 'inflated' while generating the patch.
Bug: 63334984
Test: imgdiff generates patch successfully on previous failing images.
Change-Id: Ice84f22d3653bce9756bda91e70528c0d2f264a0
|
|
|
|
|
|
|
|
| |
Also remove the utils in applypatch and replace them with the
corresponding libbase functions.
Test: recovery tests pass.
Change-Id: I77254c141bd3e7d3d6894c23b60e866009516f81
|
|
|
|
|
|
|
|
|
|
|
| |
Put ImageChunk and some helper functions into a class. Also switch to
using std::vector instead of malloc.
Bug: 18606652
Test: imgdiff_test passed on host. Also generate a complete incremental OTA package.
The file content is the same and time consumption is similar.
Change-Id: Id603ada4e130ef521218400761a119001a86ca79
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
bootable/recovery/applypatch/imgdiff.cpp:195:5: warning: Potential leak
of memory pointed to by 'img' [clang-analyzer-unix.Malloc]
Bug: 26936282
Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mm
Change-Id: Ie79c780233ddfebf85686a24df3bf2561f831580
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In zip mode, if a chunk is not deflate or its filename can't be found
in source chunks, the entire source file is used as old data for bsdiff,
To avoid repeatedly construct the suffix array used by bsdiff, we cache
the suffix array of the entire source file.
Bug: 34281147
Test: =time -v imgdiff -z Chrome-ORF74B.apk Chrome-ORF76B.apk Chrome.imgdiff
Change-Id: Ifd957ccecf7226fcb44dbf28c58969a06ef74f4b
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the input image ends with the magic value sequence of 0x1f, 0x8b,
0x0b (optionally with 0x00), the image parsing code will be stuck in an
infinite loop.
Test: recovery_component_test passes.
Change-Id: Ie3629dfdc41360387b19cc3e0359c95ae4fb998e
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Factor out libimgdiff static library for testing purpose.
This CL adds the imgdiff tests on host and on target both (similar to
libimgpatch). In practice, we only need imgdiff binary on host, and
libimgpatch on target. But they should build and pass tests on both
platforms.
Test: recovery_host_test passes; recovery_component_test passes.
Change-Id: I0eafb7faf727cdf70066310e845af6ee245d4f60
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
bootable/recovery/applypatch/imgdiff.cpp:322:11: warning: Value stored to 'ret' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
bootable/recovery/applypatch/imgdiff.cpp:447:11: warning: Value stored to 'ret' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
bootable/recovery/applypatch/imgdiff.cpp:553:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
Bug: 26936282
Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mm
Change-Id: I3f865e3e9b9d19e5ea5e8dfd2fe2c644254ffbb5
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
bootable/recovery/applypatch/imgdiff.cpp:1065:3: warning: Potential leak of memory pointed to by 'patch_data'
bootable/recovery/applypatch/imgdiff.cpp:1065:3: warning: Potential leak of memory pointed to by 'patch_size'
bootable/recovery/applypatch/imgdiff.cpp:226:7: warning: Potential leak of memory pointed to by 'temp_entries'
Bug: 26936282
Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mm
Change-Id: I3cac945d7677d367934d5619ef7419daf6f48d6f
|
|/
|
|
|
|
|
|
|
|
|
| |
static_cast is preferable to reinterpret_cast when casting from void*
pointers returned by malloc/calloc/realloc/mmap calls.
Discovered while looking at compiler warnings (b/26936282).
Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma
Change-Id: Iaffd537784aa857108f6981fdfd82d0496eb5592
Merged-In: I151642d5a60c94f312d0611576ad0143c249ba3d
|
|
|
|
|
|
| |
This reverts commit 50a6f8c8335be920833d06e5dabd37de279c98a9.
A mix of new and free leads to memory corruptions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the following cppcheck reports:
[imgdiff.cpp:197]: (error) Memory leak: img
[imgdiff.cpp:386]: (error) Memory leak: img
[imgdiff.cpp:656]: (error) Memory leak: data
[imgdiff.cpp:664]: (error) Memory leak: data
[imgdiff.cpp:668]: (error) Memory leak: data
[imgdiff.cpp:668]: (error) Resource leak: f
[imgdiff.cpp:820]: (error) Memory leak: bonus_data
[imgdiff.cpp:824]: (error) Memory leak: bonus_data
[imgdiff.cpp:824]: (error) Resource leak: f
[imgdiff.cpp:847]: (error) Memory leak: bonus_data
[imgdiff.cpp:851]: (error) Memory leak: bonus_data
[imgdiff.cpp:856]: (error) Memory leak: bonus_data
[imgdiff.cpp:860]: (error) Memory leak: bonus_data
[imgdiff.cpp:227]: (error) Memory leak: temp_entries
Change-Id: I06f878d0b677a25328e0deb84f65f3b7212e24b1
(cherry picked from commit 51dc9444bcf8d8900a521795e873d07f6cd445ef)
|
|
|
|
|
|
|
|
|
|
| |
external/bsdiff uses divsufsort which is much faster, and also include
some bug fixes.
Bug: 26982501
Test: ./imgdiff_test.sh
Change-Id: I089a301c291ee55d79938c7a3ca6d509895440d1
|
|
|
|
|
|
|
|
| |
Treat it as a normal chunk if inflate() fails.
Test: run imgdiff on corrupted gzip and apply the patch
Bug: 27153028
Change-Id: Idcbb3c1360ec0774e6c7861b21d99af8ee10604a
|
|
|
|
|
|
|
|
|
| |
Also fixed some warnings and added check for target_len.
Test: mma; emerge-peppy imgdiff; emerge-nyan imgdiff; sudo emerge imgdiff
Bug: 26866274
Change-Id: Ifbcd3afd6701c769ccf626e33ed94461706f7ee6
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dragon kernel is compressed via lz4 for boot speed and bootloader
support reasons and recent prebuilts happen to include the gzip header
sequence which is causing imgdiff to fail.
Detect a spurious gzip header and treat the section as a normal section.
Bug: 26133184
Change-Id: I369d7d576fd7d2c579c0780fc5c669a5b6ea0d3d
(cherry picked from commit 0f2f6a746af517afca9e5e089a4a17be0a9766d6)
Signed-off-by: David Riley <davidriley@google.com>
|
|
|
|
|
|
|
|
|
|
| |
mkstemp() allocates a file description that is never released. If
MakePatch() is called too many time, imgdiff reaches the Operating
System EMFILE (too many open files) limit.
Change-Id: Icbe1399f6f6d32cfa1830f879cacf7d75bbd9fc3
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Signed-off-by: Gaelle Nassiet <gaellex.nassiet@intel.com>
|
|
Mostly trivial changes to make cpp compiler happy.
Change-Id: I69bd1d96fcccf506007f6144faf37e11cfba1270
|