Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'patch-delta.c')
-rw-r--r--patch-delta.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/patch-delta.c b/patch-delta.c
index 56e0a5ede2..b937afd2c9 100644
--- a/patch-delta.c
+++ b/patch-delta.c
@@ -56,7 +56,7 @@ void *patch_delta(const void *src_buf, unsigned long src_size,
out += cp_size;
size -= cp_size;
} else if (cmd) {
- if (cmd > size)
+ if (cmd > size || cmd > top - data)
break;
memcpy(out, data, cmd);
out += cmd;