summaryrefslogtreecommitdiff
path: root/src/apply.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/apply.c')
-rw-r--r--src/apply.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/apply.c b/src/apply.c
index 8c7bb6bf3..fd1689879 100644
--- a/src/apply.c
+++ b/src/apply.c
@@ -312,8 +312,9 @@ static int apply_binary(
&patch->binary.old_file)) < 0)
goto done;
+ /* Verify that the resulting file with the reverse patch applied matches the source file */
if (source_len != reverse.size ||
- memcmp(source, reverse.ptr, source_len) != 0) {
+ (source_len && memcmp(source, reverse.ptr, source_len) != 0)) {
error = apply_err("binary patch did not apply cleanly");
goto done;
}