From nobody Fri May 10 05:54:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153006770485575.18491213801622; Tue, 26 Jun 2018 19:48:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 702C13086257; Wed, 27 Jun 2018 02:48:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2160B5C542; Wed, 27 Jun 2018 02:48:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AB9143F7CC; Wed, 27 Jun 2018 02:48:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5R2mKxk016360 for ; Tue, 26 Jun 2018 22:48:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6C31AB69DE; Wed, 27 Jun 2018 02:48:20 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6303BB69EC for ; Wed, 27 Jun 2018 02:48:16 +0000 (UTC) Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0E55181DF3 for ; Wed, 27 Jun 2018 02:48:06 +0000 (UTC) Received: by mail-qt0-f194.google.com with SMTP id y20-v6so441839qto.8 for ; Tue, 26 Jun 2018 19:48:06 -0700 (PDT) Received: from localhost.localdomain ([186.223.10.156]) by smtp.gmail.com with ESMTPSA id c9-v6sm1818116qth.35.2018.06.26.19.48.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 19:48:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=YAeF9fTusJO2vM7JOcDmMdtJGV7ic2ylPz6Us/IhWo0=; b=WqeO+P54FNH+S6rMEhnx+8VhU8yN9eP2Na5HxDfIvUZguTUvmLpfcG2du0N4ugMbQp BIwyaVDA72t38knmE5w7S2izNCtN6hxCFIJPYcxII1tI1XwtcI4SbTJv7UkEXTTAwDvG KrGKvdKSr+4a1nvje7Sdw1asQV0PJfGrVmkerF/GuITffjHTYwiyuMLPQ+3g8LSjzdpZ rzcFPNOcBEEEaF4B8qHlY0k/YOeXY7ZiuCwm3oQHbTaq0eBzCtfK0N0gV0la6KHD+0ct 7wUvetDThyZhrfzipzuY3+aN1QOiLKazQ4QrRE7K8ZzeVCLaakMzvlEIpCCsbAwP3NWX i+sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=YAeF9fTusJO2vM7JOcDmMdtJGV7ic2ylPz6Us/IhWo0=; b=gXAT1qaFkSvGpO6JmT40Fos7CtlcPz0uKFJkxGk+6BegzDP6fq0b45MVEYD3dPsToA sl9yIoY+FoR3jS1lsAVmIQmFTXQMcbXhvLDgC3dGjBH0GSCvzJct3MgBvUJZR5uAeTkb jpQ1X2/bY3c34+2oJsRiePnArhluZLC9F1QgdPcy58Noo40g4NkeCbXPHCL5by9UZvRC 96KfqeSxSOwxM5aLFiS4AwbzUK+4phs3mMZnipjugryl2727mLPi2maxzmC4RlOJZY9u OqfBv52Jmx65cgWXwYgiYmiFfq/x9mQhDQjfsOnmU5X/uRCgmnLB3Zr+HV2Ig2DrtymM Ki+g== X-Gm-Message-State: APt69E2AE2G7ZtsyxTySnSF5vhfs19hiujkWQymNvaIPf46GWrA/m1EA 6gH4ukkIxB/q1J20jcaZe9kVYw== X-Google-Smtp-Source: AAOMgpdyvKdMzo6YOn0XvmfH8LgxskQEhbxjcj4upajHjEdCfB/0B6d5vfIWT/U6gGIJkQ8rgroQaw== X-Received: by 2002:ac8:2c23:: with SMTP id d32-v6mr3864333qta.54.1530067685102; Tue, 26 Jun 2018 19:48:05 -0700 (PDT) From: Julio Faracco To: libvir-list@redhat.com Date: Tue, 26 Jun 2018 23:47:53 -0300 Message-Id: <20180627024753.15761-1-jcfaracco@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 27 Jun 2018 02:48:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 27 Jun 2018 02:48:06 +0000 (UTC) for IP:'209.85.216.194' DOMAIN:'mail-qt0-f194.google.com' HELO:'mail-qt0-f194.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.281 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS, T_DKIM_INVALID) 209.85.216.194 mail-qt0-f194.google.com 209.85.216.194 mail-qt0-f194.google.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] nwfilter: variable 'obj' must be initialized inside nwfilterBindingCreateXML(). X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 27 Jun 2018 02:48:23 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The function nwfilterBindingCreateXML() is failing to compile due to a conditional branch which leads to a undefined 'obj' variable. So 'obj' must have a initial value to avoid compilation errors. See the problem: CC nwfilter/libvirt_driver_nwfilter_impl_la-nwfilter_driver.lo nwfilter/nwfilter_driver.c:752:9: error: variable 'obj' is used uninitializ= ed whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (virNWFilterBindingCreateXMLEnsureACL(conn, def) < 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nwfilter/nwfilter_driver.c:779:10: note: uninitialized use occurs here if (!obj) ^~~ nwfilter/nwfilter_driver.c:752:5: note: remove the 'if' if its condition is= always false if (virNWFilterBindingCreateXMLEnsureACL(conn, def) < 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nwfilter/nwfilter_driver.c:742:33: note: initialize the variable 'obj' to s= ilence this warning virNWFilterBindingObjPtr obj; ^ =3D NULL This commit initialized 'obj' with NULL to fix the error properly. Signed-off-by: Julio Faracco Reviewed-by: Pavel Hrdina --- src/nwfilter/nwfilter_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index d385b46f5f..ed34586105 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -739,8 +739,8 @@ nwfilterBindingCreateXML(virConnectPtr conn, const char *xml, unsigned int flags) { - virNWFilterBindingObjPtr obj; virNWFilterBindingDefPtr def; + virNWFilterBindingObjPtr obj =3D NULL; virNWFilterBindingPtr ret =3D NULL; =20 virCheckFlags(0, NULL); --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list