aboutsummaryrefslogtreecommitdiff
path: root/xdiff-interface.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-28 14:59:28 -0700
committerJunio C Hamano <gitster@pobox.com>2015-09-28 14:59:28 -0700
commit92cdfd21313c5bf5657d4ac2d3e6ae7af7e9ce94 (patch)
tree1ee5bd8057292fc6dfa9edc58b3c2cc7b990f8ab /xdiff-interface.c
parentf2df3104ce45bc1ee6d7c16f3a02f1d157c65e07 (diff)
parent83c4d380171a2ecd24dd2e04072692ec54a7aaa5 (diff)
downloadgit-92cdfd21313c5bf5657d4ac2d3e6ae7af7e9ce94.tar.gz
git-92cdfd21313c5bf5657d4ac2d3e6ae7af7e9ce94.tar.xz
Merge branch 'jk/xdiff-memory-limits' into maint-2.3
Diffstat (limited to 'xdiff-interface.c')
-rw-r--r--xdiff-interface.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xdiff-interface.c b/xdiff-interface.c
index ecfa05f61..cb67c1c42 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -131,6 +131,9 @@ int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t co
mmfile_t a = *mf1;
mmfile_t b = *mf2;
+ if (mf1->size > MAX_XDIFF_SIZE || mf2->size > MAX_XDIFF_SIZE)
+ return -1;
+
trim_common_tail(&a, &b, xecfg->ctxlen);
return xdl_diff(&a, &b, xpp, xecfg, xecb);