Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
mailinfo: fix an off-by-one error in the boundary stack
author
Junio C Hamano
<gitster@pobox.com>
Wed, 14 Oct 2015 22:34:19 +0000
(15:34 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 19 Oct 2015 05:13:27 +0000
(22:13 -0700)
We pre-increment the pointer that we will use to store something at,
so the pointer is already beyond the end of the array if it points
at content[MAX_BOUNDARIES].
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/mailinfo.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
3a8fcda
)
diff --git
a/builtin/mailinfo.c
b/builtin/mailinfo.c
index addc0e00a6098a764ec94214f5f8743f146f3426..1566c19b6277b464607ddeb6ba0369383a0325ae 100644
(file)
--- a/
builtin/mailinfo.c
+++ b/
builtin/mailinfo.c
@@
-185,7
+185,7
@@
static void handle_content_type(struct strbuf *line)
if (slurp_attr(line->buf, "boundary=", boundary)) {
strbuf_insert(boundary, 0, "--", 2);
- if (++content_top > &content[MAX_BOUNDARIES]) {
+ if (++content_top >
=
&content[MAX_BOUNDARIES]) {
fprintf(stderr, "Too many boundaries to handle\n");
exit(1);
}