summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-11-18 23:15:56 +0000
committerGitHub <noreply@github.com>2018-11-18 23:15:56 +0000
commit646a94be5f01001e09796d03d5f6c077b21b9532 (patch)
treeeb332e330f5aacce26c9eb82dc8111c3f13ce693 /src
parent5c213e29df614391064aa3c590e329620cc91e49 (diff)
parentf127ce3505e308788dd12dcda9b18dc208da1220 (diff)
downloadlibgit2-646a94be5f01001e09796d03d5f6c077b21b9532.tar.gz
Merge pull request #4847 from noahp/noahp/null-arg-fixes
tests: 🌀 address two null argument instances
Diffstat (limited to 'src')
-rw-r--r--src/apply.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/apply.c b/src/apply.c
index 614baf7a3..28d6cd85c 100644
--- a/src/apply.c
+++ b/src/apply.c
@@ -348,8 +348,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;
}