From 274e6f6f8f46bc99219cd6c439094e92933aeba7 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 17 May 2017 12:29:50 +0200 Subject: [PATCH] libfdisk: use memcpy() for non-terminated string [coverity scan] Signed-off-by: Karel Zak --- libfdisk/src/sgi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfdisk/src/sgi.c b/libfdisk/src/sgi.c index eca112a243..b17bb4245c 100644 --- a/libfdisk/src/sgi.c +++ b/libfdisk/src/sgi.c @@ -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; -- 2.47.3