Git 2.5.6
[gitweb.git] / builtin / merge-file.c
index ea8093f6769e278c4f7871faf405fe1e3f0a7544..50d0bc873bee47ea6d1ab3b8e303e0a779465825 100644 (file)
@@ -75,7 +75,8 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
                        names[i] = argv[i];
                if (read_mmfile(mmfs + i, fname))
                        return -1;
-               if (buffer_is_binary(mmfs[i].ptr, mmfs[i].size))
+               if (mmfs[i].size > MAX_XDIFF_SIZE ||
+                   buffer_is_binary(mmfs[i].ptr, mmfs[i].size))
                        return error("Cannot merge binary files: %s",
                                        argv[i]);
        }