diff -r a2c2dd399f3b -r b6ed2505d6cf mercurial/mpatch.c --- a/mercurial/mpatch.c Fri Mar 25 10:47:49 2016 -0700 +++ b/mercurial/mpatch.c Wed Mar 16 17:29:29 2016 -0700 @@ -205,7 +205,7 @@ int pos = 0; /* assume worst case size, we won't have many of these lists */ - l = lalloc(len / 12); + l = lalloc(len / 12 + 1); if (!l) return NULL;