]> git.wh0rd.org - dump.git/blobdiff - restore/tape.c
Small buffer overflow in restore/tape.c
[dump.git] / restore / tape.c
index 5fac380f1024641b4969e204f83e9961a9706f79..d7e8ed635be54041c6872d5512e64eca52d861ea 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.38 2001/05/12 11:36:12 stelian Exp $";
+       "$Id: tape.c,v 1.39 2001/05/26 11:04:46 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -448,8 +448,8 @@ again:
                        return;
                }
                if (buf[0] != '\n') {
-                       (void) strcpy(magtape, buf);
-                       magtape[strlen(magtape) - 1] = '\0';
+                       (void) strncpy(magtape, buf, sizeof(magtape));
+                       magtape[sizeof(magtape) - 1] = '\0';
                }
        }
 #ifdef RRESTORE