e2fsprogs/e2fsprogs-strncat.patch

12 lines
557 B
Diff

--- e2fsprogs-1.39/misc/e2image.c.xx 2006-12-19 11:14:32.000000000 +0100
+++ e2fsprogs-1.39/misc/e2image.c 2006-12-19 11:16:26.000000000 +0100
@@ -126,7 +126,7 @@
hdr.magic_number = EXT2_ET_MAGIC_E2IMAGE;
strcpy(hdr.magic_descriptor, "Ext2 Image 1.0");
gethostname(hdr.fs_hostname, sizeof(hdr.fs_hostname));
- strncat(hdr.fs_device_name, device_name, sizeof(hdr.fs_device_name));
+ strncat(hdr.fs_device_name, device_name, sizeof(hdr.fs_device_name)-1);
hdr.fs_device_name[sizeof(hdr.fs_device_name) - 1] = 0;
hdr.fs_blocksize = fs->blocksize;