Thomas Rast <trast@xxxxxxxxxxxxxxx> writes: > The 'name' field passed to add_pending_object() is used to later > deduplicate in object_array_remove_duplicates(). > > git-bundle had a bug in this area since 18449ab (git-bundle: avoid > packing objects which are in the prerequisites, 2007-03-08): it passed > the name of each boundary object in a static buffer. In other words, > all that object_array_remove_duplicates() saw was the name of the > *last* added boundary object. Ouch. > diff --git a/bundle.c b/bundle.c > index 7a760db..d9cfd90 100644 > --- a/bundle.c > +++ b/bundle.c > @@ -273,7 +273,7 @@ int create_bundle(struct bundle_header *header, const char *path, > if (!get_sha1_hex(buf.buf + 1, sha1)) { > struct object *object = parse_object(sha1); > object->flags |= UNINTERESTING; > - add_pending_object(&revs, object, buf.buf); > + add_pending_object(&revs, object, xstrdup(buf.buf)); We'll release &buf after the loop but the elements in the pending object array will keep their own copies, so now we would be safe. Thanks for fixing this. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html