Hi,
On Sat, 17 Jan 2009, Thomas Rast wrote:
+static char *open_reflog(const char *ref, size_t *mapsz, const char **logfile)
+{
+ struct stat st;
+ int logfd;
+ char *map;
+
+ *logfile = git_path("logs/%s", ref);
That is dangerous. git_path() returns a pointer to a static buffer.
Before your patch, logfile was a local variable, and one could be
relatively sure that git_path() was not called during the lifetime. Now
the lifetime of logfile is no longer as clear-cut, and it is much easier
to overlook that git_path() must not be called while logfile holds a
reference to its static buffer.
Ciao,
Dscho