diff options
author | Brodie Rao <brodie@bitheap.org> | 2011-08-11 14:05:55 -0700 |
---|---|---|
committer | Brodie Rao <brodie@bitheap.org> | 2011-10-12 16:06:25 -0700 |
commit | cf7b13f3c30595e3fe88103f9bfb653655a41177 (patch) | |
tree | fec950cc75645372a379eed25c96a175c576d75d /tests/resources | |
parent | 04f788023fd04e60a12c2a19787857c72b3817f4 (diff) | |
download | libgit2-cf7b13f3c30595e3fe88103f9bfb653655a41177.tar.gz |
tag: avoid a double-free when parsing tags without a tagger field
The v0.99 tag in the Git repo triggers this behavior:
http://git.kernel.org/?p=git/git.git;a=tag;h=d6602ec5194c87b0fc87103ca4d67251c76f233a
Ideally, we'd allow the tag to be instantiated even though the tagger
field is missing, but this at the very least prevents libgit2 from
crashing.
To test this bug, a new repository has been added based on the test
branch in testrepo.git. It contains a "e90810b" tag that looks like
this:
object e90810b8df3e80c413d903f631643c716887138d
type commit
tag e90810b
This is a very simple tag.
Diffstat (limited to 'tests/resources')
-rw-r--r-- | tests/resources/bad_tag.git/HEAD | 1 | ||||
-rw-r--r-- | tests/resources/bad_tag.git/config | 5 | ||||
-rw-r--r-- | tests/resources/bad_tag.git/objects/pack/pack-7a28f4e000a17f49a41d7a79fc2f762a8a7d9164.idx | bin | 0 -> 1268 bytes | |||
-rw-r--r-- | tests/resources/bad_tag.git/objects/pack/pack-7a28f4e000a17f49a41d7a79fc2f762a8a7d9164.pack | bin | 0 -> 596 bytes | |||
-rw-r--r-- | tests/resources/bad_tag.git/packed-refs | 3 |
5 files changed, 9 insertions, 0 deletions
diff --git a/tests/resources/bad_tag.git/HEAD b/tests/resources/bad_tag.git/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/tests/resources/bad_tag.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/tests/resources/bad_tag.git/config b/tests/resources/bad_tag.git/config new file mode 100644 index 000000000..2f8958058 --- /dev/null +++ b/tests/resources/bad_tag.git/config @@ -0,0 +1,5 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = true + logallrefupdates = true diff --git a/tests/resources/bad_tag.git/objects/pack/pack-7a28f4e000a17f49a41d7a79fc2f762a8a7d9164.idx b/tests/resources/bad_tag.git/objects/pack/pack-7a28f4e000a17f49a41d7a79fc2f762a8a7d9164.idx Binary files differnew file mode 100644 index 000000000..c404aa15b --- /dev/null +++ b/tests/resources/bad_tag.git/objects/pack/pack-7a28f4e000a17f49a41d7a79fc2f762a8a7d9164.idx diff --git a/tests/resources/bad_tag.git/objects/pack/pack-7a28f4e000a17f49a41d7a79fc2f762a8a7d9164.pack b/tests/resources/bad_tag.git/objects/pack/pack-7a28f4e000a17f49a41d7a79fc2f762a8a7d9164.pack Binary files differnew file mode 100644 index 000000000..90eac5032 --- /dev/null +++ b/tests/resources/bad_tag.git/objects/pack/pack-7a28f4e000a17f49a41d7a79fc2f762a8a7d9164.pack diff --git a/tests/resources/bad_tag.git/packed-refs b/tests/resources/bad_tag.git/packed-refs new file mode 100644 index 000000000..f9fd2fd4a --- /dev/null +++ b/tests/resources/bad_tag.git/packed-refs @@ -0,0 +1,3 @@ +# pack-refs with: peeled +eda9f45a2a98d4c17a09d681d88569fa4ea91755 refs/tags/e90810b +^e90810b8df3e80c413d903f631643c716887138d |