Mercurial > public > mercurial-scm > hg
diff mercurial/diffhelpers.c @ 16651:9e40bc4c1bde stable
diffhelpers: harden testhunk
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 12 May 2012 10:02:47 +0200 |
parents | a4e0908ce35b |
children | f1aa3010642f |
line wrap: on
line diff
--- a/mercurial/diffhelpers.c Sat May 12 16:10:01 2012 +0900 +++ b/mercurial/diffhelpers.c Sat May 12 10:02:47 2012 +0200 @@ -135,7 +135,7 @@ return NULL; alen = PyList_Size(a); blen = PyList_Size(b); - if (alen > blen - bstart) { + if (alen > blen - bstart || bstart < 0) { return Py_BuildValue("l", -1); } for (i = 0; i < alen; i++) {