On Mon, Aug 10, 2015 at 4:27 PM, Jeff King wrote:
> The problem is that git_path uses a static buffer that gets overwritten
> by subsequent calls.
resolve_ref() was in the same boat, then we renamed it to
resolve_ref_unsafe(), I believe with an intention to eventually kill
it. But it lives on any
On Mon, Aug 10, 2015 at 10:31:32AM -0700, Junio C Hamano wrote:
> Jeff King writes:
>
> > The problem is that git_path uses a static buffer that gets overwritten
> > by subsequent calls.
>
> As the rotating static buffer pattern used in get_pathname() was
> modeled after sha1_to_hex(), we have
Jeff King writes:
> The problem is that git_path uses a static buffer that gets overwritten
> by subsequent calls.
As the rotating static buffer pattern used in get_pathname() was
modeled after sha1_to_hex(), we have the same issue there. They are
troubles waiting to happen unless the callers a
On 08/10/2015 11:27 AM, Jeff King wrote:
> [...] The problem is that git_path uses a static buffer that gets overwritten
> by subsequent calls. [...]
>
> [01/17]: cache.h: clarify documentation for git_path, et al
> [02/17]: cache.h: complete set of git_path_submodule helpers
> [03/17]: t570
Recently Michael and I were working on a patch series (not yet
published), which did something like:
const char *path = git_path("foo");
... do stuff with path ...
for_each_ref(some_callback, NULL);
... do some other stuff ...
unlink(path);
Clever readers may have spotted the bug i
5 matches
Mail list logo