From nobody Wed Nov 5 10:59:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534561120361547.9698927147729; Fri, 17 Aug 2018 19:58:40 -0700 (PDT) Received: from localhost ([::1]:37401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqrRn-0008BY-2s for importer@patchew.org; Fri, 17 Aug 2018 22:58:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqrQO-0007TG-F3 for qemu-devel@nongnu.org; Fri, 17 Aug 2018 22:57:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqrQJ-0002Mn-HF for qemu-devel@nongnu.org; Fri, 17 Aug 2018 22:57:12 -0400 Received: from mail-vk0-x244.google.com ([2607:f8b0:400c:c05::244]:39808) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fqrQJ-0002ML-Br; Fri, 17 Aug 2018 22:57:07 -0400 Received: by mail-vk0-x244.google.com with SMTP id e139-v6so4101959vkf.6; Fri, 17 Aug 2018 19:57:07 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id j7-v6sm1383374vka.43.2018.08.17.19.57.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 19:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zZp8sws8Jom7wHnaY9m6i2pwewPlZSa16z6KmBFeE00=; b=Cz2YvptXJ0CgTkOdDxMNcaG6FljIhr1QPm5KRxgrdI9AqmsODb4UkS8JcPDeYDcQGX QFi1z+CWC/7N1ohfo52omgC+mU9zOKoREEnXXrGdr+7w4IcBmkqQ0VqeUpReTRq/9Yga 7VfzEQLAh5CgzhoRJ1h6ATkFYS6ekS1uRXzjcr1fuZoWFKsEc/w1c9VSZ7u/jWaPO1Ij GeCf07VPZSIJ/HRswxL02SWVeiDRjvTH9KinV7teUO6/a2iFw7trSzwXnLw61kH8plyO rsW9bVVUHYSZC1OnDVypzgZQIBZzC/hG6Hebndt14u2LVWgQOzwOKSGiUtLlTgZZsEZx 7+3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=zZp8sws8Jom7wHnaY9m6i2pwewPlZSa16z6KmBFeE00=; b=Lqe7SCTk4mSSuQaXFdhgqzqZjz0sMFq2TG+QL1MYXKdbB/gX92MNRmv3To1loHkBDt 8wX0YXlXFTTjvD2QBsrVEshII8oG/MgA+EmUmwTJiurtRI3jQmR0j3mt2ON0n1Rml7T7 UkryRKSZRLDnqs8gS41BMcdtt6LTnJebD79LANod/Mp36AKGkUQz6HomFBloyRxiUDev +sWjNVxX8y5zjJcNxVcTGluHgE1WOFq+L38zV1Tc+Po/LxttOb97deZu/zBUDdwBHJeO yXKuZ9RjNJvMZLN4ekUxYSZbYLYzhfZBafQBsfD3bb/Kj1ZKN6MrkQwUYkI6EdYfWBhS f9ew== X-Gm-Message-State: AOUpUlFi4JMkQnnYV9/UtMomEhbxbYU3NusYVu73T2ot+SNfKDO9JAIO tj83Io/ZnmYIYX/15/pMZDI= X-Google-Smtp-Source: AA+uWPzjFJuf/wyWvJm+j1m7sxloyyiIW+zfS+vMCNuifap/ONg7sg2/W9fzxHsGpWk7l28JyfGSKg== X-Received: by 2002:a1f:b60f:: with SMTP id g15-v6mr24603054vkf.27.1534561026922; Fri, 17 Aug 2018 19:57:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Juan Quintela , "Dr. David Alan Gilbert" , David Hildenbrand , Howard Spoelstra Date: Fri, 17 Aug 2018 23:56:53 -0300 Message-Id: <20180818025653.21192-1-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c05::244 Subject: [Qemu-devel] [PATCH] migration: Replace strncpy() by g_strlcpy() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Fedora 29 comes with GCC 8.1 which added the 'stringop-truncation' checks. Replace the strncpy() calls by g_strlcpy() to avoid the following warning: migration/global_state.c: In function 'global_state_store_running': migration/global_state.c:45:5: error: 'strncpy' specified bound 100 equal= s destination size [-Werror=3Dstringop-truncation] strncpy((char *)global_state.runstate, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ state, sizeof(global_state.runstate)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: Howard Spoelstra Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: David Hildenbrand Reviewed-by: Juan Quintela --- See http://lists.nongnu.org/archive/html/qemu-devel/2018-07/msg03723.html migration/global_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/global_state.c b/migration/global_state.c index 8e8ab5c51e..d5df502cd5 100644 --- a/migration/global_state.c +++ b/migration/global_state.c @@ -42,7 +42,7 @@ int global_state_store(void) void global_state_store_running(void) { const char *state =3D RunState_str(RUN_STATE_RUNNING); - strncpy((char *)global_state.runstate, + g_strlcpy((char *)global_state.runstate, state, sizeof(global_state.runstate)); } =20 --=20 2.18.0