Commit c252785
fast-import: fix buffer overflow in dump_tags
When creating a new annotated tag, we sprintf the refname
into a static-sized buffer. If we have an absurdly long
tagname, like:
git init repo &&
cd repo &&
git commit --allow-empty -m foo &&
git tag -m message mytag &&
git fast-export mytag |
perl -lpe '/^tag/ and s/mytag/"a" x 8192/e' |
git fast-import <input
we'll overflow the buffer. We can fix it by using a strbuf.
Signed-off-by: Jeff King <[email protected]>
Reviewed-by: Michael Haggerty <[email protected]>
Reviewed-by: Ronnie Sahlberg <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 3c078b9 commit c252785
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1730 | 1730 | | |
1731 | 1731 | | |
1732 | 1732 | | |
1733 | | - | |
| 1733 | + | |
1734 | 1734 | | |
1735 | 1735 | | |
1736 | | - | |
1737 | | - | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
1738 | 1739 | | |
1739 | | - | |
| 1740 | + | |
1740 | 1741 | | |
| 1742 | + | |
1741 | 1743 | | |
1742 | 1744 | | |
1743 | 1745 | | |
| |||
0 commit comments