From nobody Tue May 7 02:42:28 2024 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=1611247266; cv=none; d=zohomail.com; s=zohoarc; b=iR8RA1EXoVGi28wT2njHye0c7L99hbukDb3SzabdwXFbzKLNgLy+bKYe61M0wKFa944efJonZ07jpXm1gzqSu6XoRulyXqvZSQ7Qdb2FtvAdWjsXzUkydcBES+06X8xWO4b5wxA21OFQDhI6S3hbplkTVOAoEmOL3u9+mQV1KJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611247266; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=F3yaRX21RpmOSSA7nzRsqL4jKkQljT7gBkA/aNva1qw=; b=UjCT8cIMH+nKsNWhrwEEJgj6dRAWlOoL+D7yn8c09A0fNwvuPwAnJ1Vf6/5IybKvd1monKvy93ltjEzWcjt6vbTm5KzFzMOmIWwjdTuHq6DLm4ajhYahk+CpjEpe4eAVkwUGxJAFMULuyAWvA289j5ynx6X8d5vBozuSe7XeZvs= 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 1611247266068900.5600629918348; Thu, 21 Jan 2021 08:41:06 -0800 (PST) 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-142-wHJyAGvpPgGfdf6_5waNdg-1; Thu, 21 Jan 2021 11:41:02 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 56DD2107ACE3; Thu, 21 Jan 2021 16:40:56 +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 864F7100239A; Thu, 21 Jan 2021 16:40:55 +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 8DB6E4BB7B; Thu, 21 Jan 2021 16:40:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10LGeO4n031616 for ; Thu, 21 Jan 2021 11:40:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 50D0D5D9C6; Thu, 21 Jan 2021 16:40:24 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6D675D9DD for ; Thu, 21 Jan 2021 16:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611247264; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=F3yaRX21RpmOSSA7nzRsqL4jKkQljT7gBkA/aNva1qw=; b=QL7X2nCJ57BTy9ME7S6GsvdgOsMbRl5R0OtUbg2DQzVvmZCqbjmMElBjBTJuwDc6XVMPU1 QDDe/xCUzTL0BVuH26LehcVzHcWUXUyFccuOqT1GYTDT5PM8N/axADaVChIlqPI9SJYZ7u 21bWKlPIAU5ZKP/F6lhHzg9dioA7nho= X-MC-Unique: wHJyAGvpPgGfdf6_5waNdg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] virNetworkDHCPLeaseTimeDefParseXML: Output error when 'expiry' can't be parsed Date: Thu, 21 Jan 2021 17:40:19 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.84 on 10.5.11.22 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" virStrToLong_ul doesn't report it's own error. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1918674 Signed-off-by: Peter Krempa Reviewed-by: Laine Stump --- src/conf/network_conf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 4f1115e103..ff7a56f4f4 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -418,8 +418,11 @@ virNetworkDHCPLeaseTimeDefParseXML(virNetworkDHCPLease= TimeDefPtr *lease, if (!(expirystr =3D virXMLPropString(node, "expiry"))) return 0; - if (virStrToLong_ul(expirystr, NULL, 10, &expiry) < 0) + if (virStrToLong_ul(expirystr, NULL, 10, &expiry) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("failed to parse expiry value '%s'"), expirystr); return -1; + } if ((unitstr =3D virXMLPropString(node, "unit"))) { if ((unit =3D virNetworkDHCPLeaseTimeUnitTypeFromString(unitstr)) = < 0) { --=20 2.29.2