From nobody Sun Feb 8 22:54:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1621936144; cv=none; d=zohomail.com; s=zohoarc; b=eGjJ/MYHP9b/hWYLavxEilmwi2NwaFbORbx99SMRaKTDV7uUE+4AWUcSN3gNWHkbeGAVjHwcvZcKYG5wwnsZao/ncSq136UwkEg1rjOMFrkxxcQSXfE7sk06tl7p2l48DENKKIBtPEUa8Q/AoEHkGFfErFB79bAt8wFx7Gt9J0g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621936144; 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=1QsUg0BP8h//ATOoYuhqxjSJKt6kjTbYa0hkueQuv2I=; b=keuiF9B1uYAvUczhnlq3/TqsqUjL4EA+HTbIDCjc6raPDyY677rW4y/3XvihUUb+kFt+Ln985ghO/9RJiqCf3/9UOWu7b/1AMixv/1GCakpN9AeBNGRWDNabOXB75YSU6TJTf36m4gnRxfxfGz2zu9ZOSsn/7dweQiNXSCfBvFk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1621936144025887.5192610961184; Tue, 25 May 2021 02:49:04 -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-335-xPLN7kAOPduQ-vt30f1yYQ-1; Tue, 25 May 2021 05:49:00 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 56AFE800FF0; Tue, 25 May 2021 09:48:54 +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 36E4A70585; Tue, 25 May 2021 09:48:54 +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 D107655341; Tue, 25 May 2021 09:48:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14P9mZq8031358 for ; Tue, 25 May 2021 05:48:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id A4A7919CB6; Tue, 25 May 2021 09:48:35 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 292286C332 for ; Tue, 25 May 2021 09:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621936143; 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=1QsUg0BP8h//ATOoYuhqxjSJKt6kjTbYa0hkueQuv2I=; b=gdAF70HudmLX309GiTaA0KO2arhNy119DA+jtqnOBDAzsL7QBSZLBs3TXkZ8AA6Fzdukd8 NXpMjZGdSou8v8Hwdqrl28hP7aX3wojvpzBcAmgCZevhp5lW5PXJVG8cjMa01xxcHfan6K iVlKQC3OdTM1/hwNhNgObpStbXO2woM= X-MC-Unique: xPLN7kAOPduQ-vt30f1yYQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 2/3] virxml: Report error if virXMLFormatMetadata() fails Date: Tue, 25 May 2021 11:48:27 +0200 Message-Id: <5b5a49d66b8123fed529dc8f707c601411517699.1621936048.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.12 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" I guess this is more of an academic problem, because if content was problematic we would have caught the error during parsing. Anyway, as is this function returns -1 without any error reported. Fix it by reporting one. Signed-off-by: Michal Privoznik --- src/util/virxml.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virxml.c b/src/util/virxml.c index 062a5402f6..91c6f6b02e 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -1740,6 +1740,8 @@ virXMLFormatMetadata(virBuffer *buf, if (xmlNodeDump(xmlbuf, metadata->doc, metadata, virBufferGetIndent(buf) / 2, 1) < 0) { xmlIndentTreeOutput =3D oldIndentTreeOutput; + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to format metadata element")); return -1; } =20 --=20 2.26.3