From nobody Sat May 4 17:13:48 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1567175195; cv=none; d=zoho.com; s=zohoarc; b=XY3wk+K9oEutPotUTgizjqGA0qL76iPJ7+3G+CH7Vmw5ZV3fle7qLJ88rEH1fn1hbO18rmDN1eQJO+NBhgK9RGFXPFN3Jlq6BD1JoSHlMMv6MU9np3WyfX1tGurIB0ZfIVcPoDADOlxePFPkTKY8q+XCVv9EArRVSg4MoKKINjA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567175195; 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:ARC-Authentication-Results; bh=xfPvT74gWE+TwP9sgocuVJBK0cE7ot220s2yeiLqDjc=; b=ETstJ3/fVbjPB7m72G+49mhZ9+3zb3RJtB4XJtZLTGmWSj2nINynVugKMqdBzcSpFI+utAztNh1dowCAwdUZ+y0Yp6GbH95CzryvT6q7p+PQj1aEgotsHgfRiCnUCrqamd4vFYTp6r9BycIDQd+CNsoN1Lo9JTyck0c8DIPGKZE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156717519570483.09776703508373; Fri, 30 Aug 2019 07:26:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 940D3806CE; Fri, 30 Aug 2019 14:26:33 +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 6D00260166; Fri, 30 Aug 2019 14:26:32 +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 2FB931802218; Fri, 30 Aug 2019 14:26:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7UEQR4N023423 for ; Fri, 30 Aug 2019 10:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 62E1C608C1; Fri, 30 Aug 2019 14:26:27 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFC0F60606 for ; Fri, 30 Aug 2019 14:26:24 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Fri, 30 Aug 2019 16:26:23 +0200 Message-Id: <6369cc4d33a61c42cd577d0601d4c0ff3e9a0b98.1567174900.git.phrdina@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] vircgroupv2: fix abort in VIR_AUTOFREE 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: , 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 30 Aug 2019 14:26:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Introduced by commit that tried to fix an issue where we would fail to parse values from files. We cannot change the original pointer that is going to be used by VIR_AUTOFREE. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1747440 Signed-off-by: Pavel Hrdina --- Sigh, shame on me! src/util/vircgroupv2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index c62ee0d933..2aca4e5d62 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -849,6 +849,7 @@ virCgroupV2GetBlkioDeviceWeight(virCgroupPtr group, VIR_AUTOFREE(char *) path =3D NULL; VIR_AUTOFREE(char *) str =3D NULL; VIR_AUTOFREE(char *) value =3D NULL; + char *tmp; =20 if (virCgroupV2PathOfController(group, VIR_CGROUP_CONTROLLER_BLKIO, "io.weight", &path) < 0) { @@ -869,7 +870,7 @@ virCgroupV2GetBlkioDeviceWeight(virCgroupPtr group, =20 if (!str) { *weight =3D 0; - } else if (virStrToLong_ui(str, &str, 10, weight) < 0) { + } else if (virStrToLong_ui(str, &tmp, 10, weight) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unable to parse '%s' as an integer"), str); @@ -1576,6 +1577,7 @@ virCgroupV2GetCpuCfsQuota(virCgroupPtr group, long long *cfs_quota) { VIR_AUTOFREE(char *) str =3D NULL; + char *tmp; =20 if (virCgroupGetValueStr(group, VIR_CGROUP_CONTROLLER_CPU, "cpu.max", &str) < 0) { @@ -1587,7 +1589,7 @@ virCgroupV2GetCpuCfsQuota(virCgroupPtr group, return 0; } =20 - if (virStrToLong_ll(str, &str, 10, cfs_quota) < 0) { + if (virStrToLong_ll(str, &tmp, 10, cfs_quota) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to parse value '%s' from cpu.max."), str); return -1; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list