From nobody Tue Oct 28 12:38:31 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; 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 1514902104062255.99162522887718; Tue, 2 Jan 2018 06:08:24 -0800 (PST) Received: from localhost ([::1]:43879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWNEp-0008GE-9C for importer@patchew.org; Tue, 02 Jan 2018 09:08:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWND9-0007Gs-Uk for qemu-devel@nongnu.org; Tue, 02 Jan 2018 09:06:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWND6-0008Di-P2 for qemu-devel@nongnu.org; Tue, 02 Jan 2018 09:06:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51224) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eWND6-0008Co-Jg for qemu-devel@nongnu.org; Tue, 02 Jan 2018 09:06:32 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC0293449C8; Tue, 2 Jan 2018 14:06:31 +0000 (UTC) Received: from localhost (ovpn-112-33.ams2.redhat.com [10.36.112.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 699415D9C8; Tue, 2 Jan 2018 14:06:31 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Tue, 2 Jan 2018 15:06:24 +0100 Message-Id: <20180102140625.14477-2-marcandre.lureau@redhat.com> In-Reply-To: <20180102140625.14477-1-marcandre.lureau@redhat.com> References: <20180102140625.14477-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 02 Jan 2018 14:06:31 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/2] dump: fix note_name_equal() 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: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the function argument "name" instead of hardcoded "VMCOREINFO". All callers use "VMCOREINFO" as argument, so this isn't an exposed bug, thankfully. Simplify a little bit the code while touching this. Suggested-by: Andrew Jones Reported-by: Laszlo Ersek Signed-off-by: Marc-Andr=C3=A9 Lureau --- dump.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dump.c b/dump.c index d4a8c942eb..e9dfed060a 100644 --- a/dump.c +++ b/dump.c @@ -788,12 +788,7 @@ static bool note_name_equal(DumpState *s, get_note_sizes(s, note, &head_size, &name_size, NULL); head_size =3D ROUND_UP(head_size, 4); =20 - if (name_size !=3D len || - memcmp(note + head_size, "VMCOREINFO", len)) { - return false; - } - - return true; + return name_size =3D=3D len && memcmp(note + head_size, name, len) =3D= =3D 0; } =20 /* write common header, sub header and elf note to vmcore */ --=20 2.15.1.355.g36791d7216