summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/client/clitar.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index d7d47fc903..eba82ba217 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -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 */
}