1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

Arrrgh, one more fix. Restores of long file names were

broken ...

Added a bzero of the buffer the names went into ...

Seems OK now ...

Richard Sharpe
This commit is contained in:
Richard Sharpe 0001-01-01 00:00:00 +00:00
parent dc9436bae4
commit c749c8d046

View File

@ -1888,14 +1888,19 @@ static void do_tarput()
return;
}
bzero(longname, finfo.size + strlen(cur_dir) +1);
buffer_p += TBLOCK; /* Skip that longlink header */
/* This needs restructuring ... */
strncpy(longname, cur_dir, strlen(cur_dir) + 1);
safe_strcpy(longname, cur_dir, strlen(cur_dir) + 1);
cp = longname + strlen(cur_dir);
file_len = finfo.size;
DEBUG(5, ("longname=%0X, cp=%0X, file_len=%i\n", longname, cp, file_len));
while (file_len > 0) {
if (buffer_p >= endofbuffer) {
@ -1912,7 +1917,7 @@ static void do_tarput()
cp = cp + strlen(cp); /* Move to end of string */
buffer_p += TBLOCK;
file_len -= TBLOCK;
DEBUG(5, ("cp=%0X, file_len=%i\n", cp, file_len));
next_header = 1; /* Force read of next header */
}