On Aug 17, 2013, at 06:34, René Scharfe wrote:
On Aug 15, 2013, at 17:12, Stefan Beller wrote:
+               if (sha_begin >= e->d_name && !strncmp(sha_begin, sha1, 40)) {
+                       char *fname;
+                       fname = xmalloc(strlen(path) + 1 + strlen(e->d_name));

This needs another +1 because

+                       sprintf(fname, "%s/%s", path, e->d_name);

len(path) + len("/") + len(e->d_name) + len("\0")


mkpathdup..

+                       unlink(fname);
+                       /*TODO: free(fname); fails here sometimes, needs 
investigation*/

Strange.  Perhaps valgrind can tell you what's wrong.

which is probably why it fails since the byte beyond the end of fname is being overwritten with a nul.--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to