]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: use memcpy() for non-terminated string [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 17 May 2017 10:29:50 +0000 (12:29 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 17 May 2017 10:29:50 +0000 (12:29 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/sgi.c

index eca112a243419de3f29b3593249f9a34043af5d3..b17bb4245c352793126ba084830a592358149016 100644 (file)
@@ -153,7 +153,7 @@ int fdisk_sgi_create_info(struct fdisk_context *cxt)
        /* I keep SGI's habit to write the sgilabel to the second block */
        sgilabel->volume[0].block_num = cpu_to_be32(2);
        sgilabel->volume[0].num_bytes = cpu_to_be32(sizeof(struct sgi_info));
-       strncpy((char *) sgilabel->volume[0].name, "sgilabel", 8);
+       memcpy((char *) sgilabel->volume[0].name, "sgilabel", 8);
 
        fdisk_info(cxt, _("SGI info created on second sector."));
        return 0;