Commit 21c74542 authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

BUG: Fix extract. Looks like dirname actually changes the string, so temporary...

BUG: Fix extract. Looks like dirname actually changes the string, so temporary string should be used
parent cef4806c
......@@ -213,8 +213,14 @@ tar_extract_regfile(TAR *t, char *realname)
uid = th_get_uid(t);
gid = th_get_gid(t);
if (mkdirhier(dirname(filename)) == -1)
strncpy(buf, filename, sizeof(buf)-1);
buf[sizeof(buf)-1] = 0;
if (mkdirhier(dirname(buf)) == -1)
{
return -1;
}
#ifdef DEBUG
printf(" ==> extracting: %s (mode %04o, uid %d, gid %d, %d bytes)\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment