SHA256
1
0
forked from pool/tar
tar/tar-fortifysourcessigabrt.patch

27 lines
970 B
Diff

Index: tar-1.25/src/create.c
===================================================================
--- tar-1.25.orig/src/create.c
+++ tar-1.25/src/create.c
@@ -517,8 +517,8 @@ start_private_header (const char *name,
GID_TO_CHARS (getgid (), header->header.gid);
MAJOR_TO_CHARS (0, header->header.devmajor);
MINOR_TO_CHARS (0, header->header.devminor);
- strncpy (header->header.magic, TMAGIC, TMAGLEN);
- strncpy (header->header.version, TVERSION, TVERSLEN);
+ memcpy (header->header.magic, TMAGIC, TMAGLEN);
+ memcpy (header->header.version, TVERSION, TVERSLEN);
return header;
}
@@ -906,8 +906,8 @@ start_header (struct tar_stat_info *st)
case POSIX_FORMAT:
case USTAR_FORMAT:
- strncpy (header->header.magic, TMAGIC, TMAGLEN);
- strncpy (header->header.version, TVERSION, TVERSLEN);
+ memcpy (header->header.magic, TMAGIC, TMAGLEN);
+ memcpy (header->header.version, TVERSION, TVERSLEN);
break;
default: