From nobody Mon Feb 9 03:48:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1691059023; cv=none; d=zohomail.com; s=zohoarc; b=h3ECWroZO9AMz0HJP3VoB9wfAycjWeKT8T4QghESAwPlyUuAkaMAGAJR1NOf/4lANhgW2jn7uT9wrSTqNaqq8RM5QC+9dBlOJ57g/vhdP3sH+zzCGnqrPeINeb/JGPzR87KXHYmvY7vJPV7VtYS19EBxxwrUt03xHSqoqoSw3uY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691059023; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=k+5HISJmaXA1wbSYQpEt3JITeINECTqaCtIZZpuZ+sU=; b=h5z3E61gRXiZok3Gpt3q+0F4laUInaYJ8RPIDvy6krXFcBGAZdwOj6VtiH9GIvurszW4EbOP+9/lkssZ+38HrpdejChAIux3bE66uaF/4vJJu3BVWvbXDP4nWdJHS/3ZCf8U6z6QXqRGoNzTFKRKlMBMMGTgPRN2JgJhe+R1s00= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1691059023762230.8206994587116; Thu, 3 Aug 2023 03:37:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-axgHiai1OLeAhZXzymo5AQ-1; Thu, 03 Aug 2023 06:36:29 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EF9B71C05B06; Thu, 3 Aug 2023 10:36:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9CEAA48FB00; Thu, 3 Aug 2023 10:36:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AD68C1947222; Thu, 3 Aug 2023 10:36:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 238A91946A78 for ; Thu, 3 Aug 2023 10:36:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0681EF7FA6; Thu, 3 Aug 2023 10:36:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2263F7FBA for ; Thu, 3 Aug 2023 10:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691059022; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=k+5HISJmaXA1wbSYQpEt3JITeINECTqaCtIZZpuZ+sU=; b=FPpTnPQkQ2zpDjAIVllbdjjbpt2gEyCG4c8J9CM+DlTMFNdb0lU6mlMD69ax4C3Xf25+rV VxaCU8qyf2+FpjKTlxLj85L0qs+kl6c9GDYuWRA6rzB8YwgoBkzCwKlH5xJQ6sdx0Ulms3 wz5urLEIF+TCv4/C0uaevHoFkWocYAI= X-MC-Unique: axgHiai1OLeAhZXzymo5AQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 02/13] virt-aa-helper: Use struct zero initializer instead of memset Date: Thu, 3 Aug 2023 12:36:09 +0200 Message-ID: <55a87f03b758722453d98bc912d14c165f166053.1691058853.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1691059024664100003 Content-Type: text/plain; charset="utf-8"; x-default="true" This is similar to the previous commit, except this is for a different type (vahControl) and also fixes the case where _ctl is passed not initialized to vah_error() (via ctl pointer so that's probably why compilers don't complain). Signed-off-by: Michal Privoznik Reviewed-by: Claudio Fontana --- src/security/virt-aa-helper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 3ee59b32bb..da1e4fc3e4 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1433,7 +1433,8 @@ vahParseArgv(vahControl * ctl, int argc, char **argv) int main(int argc, char **argv) { - vahControl _ctl, *ctl =3D &_ctl; + vahControl _ctl =3D { 0 }; + vahControl *ctl =3D &_ctl; int rc =3D -1; char *profile =3D NULL; char *include_file =3D NULL; @@ -1466,8 +1467,6 @@ main(int argc, char **argv) else progname++; =20 - memset(ctl, 0, sizeof(vahControl)); - if (vahParseArgv(ctl, argc, argv) !=3D 0) vah_error(ctl, 1, _("could not parse arguments")); =20 --=20 2.41.0