Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
strbuf_addbuf(): allow passing the same buf to dst and src
If sb and sb2 are the same (i.e. doubling the string), the underlying strbuf_add() can make sb2->buf invalid by calling strbuf_grow(sb) at the beginning; if realloc(3) done by strbuf_grow() needs to move the string, strbuf_add() will read from an already freed buffer. Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information