]> git.wh0rd.org - dump.git/commitdiff
Fix a problem in restore where the final \0 in the symbolic
authorStelian Pop <stelian@popies.net>
Fri, 10 Dec 2004 13:31:20 +0000 (13:31 +0000)
committerStelian Pop <stelian@popies.net>
Fri, 10 Dec 2004 13:31:20 +0000 (13:31 +0000)
link names could have been lost, generating corrupt filenames.

CHANGES
THANKS
restore/tape.c

diff --git a/CHANGES b/CHANGES
index 5ae2f0a8f994b646c7d9ad3589abac5e6ccab20b..726d0eec9c52e5513c5311d777af9c93809e784c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.259 2004/11/22 10:32:31 stelian Exp $
+$Id: CHANGES,v 1.260 2004/12/10 13:31:20 stelian Exp $
 
 Changes between versions 0.4b37 and 0.4b38 (released ????????????)
 ==================================================================
@@ -22,6 +22,11 @@ Changes between versions 0.4b37 and 0.4b38 (released ????????????)
        Thanks to Kevin B. Haines <K.B.Haines@rl.ac.uk> for 
        submitting the bug and testing the fix.
 
+6.     Fix a problem in restore where the final \0 in the symbolic
+       link names could have been lost, generating corrupt filenames.
+       Thanks to Kyle Wilson <kyle.wilson@amd.com> for reporting the
+       bug.
+
 Changes between versions 0.4b36 and 0.4b37 (released July 7, 2004)
 ==================================================================
 
diff --git a/THANKS b/THANKS
index 98a98e31eb3210e87d653abd99508fa38a49caba..d1a6558eb625ffde278570dada84b44d28f9025c 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,4 +1,4 @@
-$Id: THANKS,v 1.87 2004/11/22 10:32:31 stelian Exp $
+$Id: THANKS,v 1.88 2004/12/10 13:31:20 stelian Exp $
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
@@ -129,6 +129,7 @@ Daniel Veillard             Daniel.Veillard@imag.fr
 Jason Venner           jason@idiom.com
 John I Wang            jiwang@users.sourceforge.net
 Christian Weisgerber   naddy@mips.rhein-neckar.de
+Kyle Wilson            kyle.wilson@amd.com
 Kim Yong-jun           loveyou@hackerslab.org
 John Yu                        jky@it.bu.edu
 Ian Zimmerman          itz@speakeasy.org
index 29807646f2aa01ba4133ecb9b688babfe712d0b8..b383866a6dd99bc9535d3d81d66ec7d35d107e39 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.82 2004/08/16 09:39:47 stelian Exp $";
+       "$Id: tape.c,v 1.83 2004/12/10 13:31:21 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -1317,10 +1317,13 @@ xtrlnkfile(char *buf, size_t size)
 {
 
        pathlen += size;
-       if (pathlen > MAXPATHLEN)
+       if (pathlen > MAXPATHLEN) {
+               buf[size - 1] = '\0';
                errx(1, "symbolic link name: %s->%s%s; too long %d",
                    curfile.name, lnkbuf, buf, pathlen);
+       }
        (void) strcat(lnkbuf, buf);
+       lnkbuf[pathlen] = '\0';
 }
 
 /*