The linker on OpenBSD complains: ld: warning: dirtyrate.c:447 (../src/migration/dirtyrate.c:447)(...): warning: strcpy() is almost always misused, please use strlcpy()
It's currently not a real problem in this case since both arrays have the same size (256 bytes). But just in case somebody changes the size of the source array in the future, let's better play safe and use g_strlcpy() here instead. Signed-off-by: Thomas Huth <th...@redhat.com> --- migration/dirtyrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c index 233acb0855..090c76e934 100644 --- a/migration/dirtyrate.c +++ b/migration/dirtyrate.c @@ -444,7 +444,7 @@ static void get_ramblock_dirty_info(RAMBlock *block, info->ramblock_pages = qemu_ram_get_used_length(block) >> qemu_target_page_bits(); info->ramblock_addr = qemu_ram_get_host_addr(block); - strcpy(info->idstr, qemu_ram_get_idstr(block)); + g_strlcpy(info->idstr, qemu_ram_get_idstr(block), sizeof(info->idstr)); } static void free_ramblock_dirty_info(struct RamblockDirtyInfo *infos, int count) -- 2.47.0