From nobody Sun Feb 8 11:21:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1601850256; cv=none; d=zohomail.com; s=zohoarc; b=EI/sdqLkps7RLp6njsiJMn/uRK6rNuZ+W2m4Jlm6cxJJapyt+Kyfu7ya839rByeWhwMmnudisrOdjFwuRgYbZLHrbUhBJpLHLN/fnmWyWrbFcS5PikgScE3mauBgbF9skoZ7Fs/tG5bVOQrhN47fV8Gf19e+7NQDA7zDGpjBs0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601850256; 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=mbqzDEWIloitBYizPM+o6TuI6GykNqswLHnTjtE5O0M=; b=HsSZOnKY6l8NniHbNdwjd9mTFLh5P27Ndqcc7e5FvF1PVuAmH+yzwBMe9k+UNsJ7jL0d6xYh9suNy02QPk7ZmT6K/wJTroK43UqqwQbZB2s3zQjGgvCLwtwMk+wtJwmebnCjgR8h2u+CcejU4kKx+W4ShPfRGJ0SOD+6Vh/iVfQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601850256928425.0858990820002; Sun, 4 Oct 2020 15:24:16 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-310-Bo2IuUQqO8iX3w2Z1BZUxA-1; Sun, 04 Oct 2020 18:24:13 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id A33A81DDF9; Sun, 4 Oct 2020 22:24:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 815905D9CC; Sun, 4 Oct 2020 22:24:08 +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 47443181A88C; Sun, 4 Oct 2020 22:24:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 094MO4MW031892 for ; Sun, 4 Oct 2020 18:24:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id E85455C22E; Sun, 4 Oct 2020 22:24:04 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 703F15C22B for ; Sun, 4 Oct 2020 22:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601850255; 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=mbqzDEWIloitBYizPM+o6TuI6GykNqswLHnTjtE5O0M=; b=Fkl/3al6fDMzht3nvUHWOCU9tPLB5/uGyps5E051yY2FGJSQMObo4tJ9oGDuC5kogTxhiB ld1RN2/lt9plf9XT72+C2CbCsTJjsVRkcBq0EyVyr+oRS3Gc2hGtWs7/kfrju3r6Aus65i WEn2PeuPlWzQUc2SMKVqnx1FPAIv7Ss= X-MC-Unique: Bo2IuUQqO8iX3w2Z1BZUxA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/4] vz: separate if conditions in vzEatCookie Date: Mon, 5 Oct 2020 00:23:56 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Create a separate scope where 'tmp' variable can be used. Signed-off-by: J=C3=A1n Tomko --- src/vz/vz_driver.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 40b1828eb2..5b40f9a835 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -2806,26 +2806,28 @@ vzEatCookie(const char *cookiein, int cookieinlen, = unsigned int flags) _("(_migration_cookie)"), &ctx))) goto error; =20 - if ((flags & VZ_MIGRATION_COOKIE_SESSION_UUID) - && (!(tmp =3D virXPathString("string(./session-uuid[1])", ctx)) + if (flags & VZ_MIGRATION_COOKIE_SESSION_UUID) { + if ((!(tmp =3D virXPathString("string(./session-uuid[1])", ctx)) || (VIR_ALLOC_N(mig->session_uuid, VIR_UUID_BUFLEN) < 0) || (virUUIDParse(tmp, mig->session_uuid) < 0))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing or malformed session-uuid element " - "in migration data")); - VIR_FREE(tmp); - goto error; + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing or malformed session-uuid element " + "in migration data")); + VIR_FREE(tmp); + goto error; + } } VIR_FREE(tmp); =20 - if ((flags & VZ_MIGRATION_COOKIE_DOMAIN_UUID) - && (!(tmp =3D virXPathString("string(./uuid[1])", ctx)) + if (flags & VZ_MIGRATION_COOKIE_DOMAIN_UUID) { + if ((!(tmp =3D virXPathString("string(./uuid[1])", ctx)) || (VIR_ALLOC_N(mig->uuid, VIR_UUID_BUFLEN) < 0) || (virUUIDParse(tmp, mig->uuid) < 0))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing or malformed uuid element in migration d= ata")); - VIR_FREE(tmp); - goto error; + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing or malformed uuid element in migrati= on data")); + VIR_FREE(tmp); + goto error; + } } VIR_FREE(tmp); =20 --=20 2.26.2