diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-09-05 23:37:02 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-09-05 23:37:02 -0700 |
commit | 7e2e69b7f67ba8b336be56508d0208117d9e22e3 (patch) | |
tree | f10cda2462596cb0939c5dd0d0373bff5a2aaee0 /builtin-apply.c | |
parent | Merge branch 'ds/sendmail' (diff) | |
parent | Include a git-push example for creating a remote branch (diff) | |
download | tgif-7e2e69b7f67ba8b336be56508d0208117d9e22e3.tar.xz |
Merge branch 'maint'
* maint:
Include a git-push example for creating a remote branch
Cleanup unnecessary file modifications in t1400-update-ref
Makefile: Add cache-tree.h to the headers list
Don't allow contrib/workdir/git-new-workdir to trash existing dirs
git-apply: do not read past the end of buffer
Diffstat (limited to 'builtin-apply.c')
-rw-r--r-- | builtin-apply.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-apply.c b/builtin-apply.c index 25b1447901..976ec77041 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -1514,7 +1514,8 @@ static int find_offset(const char *buf, unsigned long size, const char *fragment } /* Exact line number? */ - if (!memcmp(buf + start, fragment, fragsize)) + if ((start + fragsize <= size) && + !memcmp(buf + start, fragment, fragsize)) return start; /* |