From nobody Sun Oct 5 21:10:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555521185; cv=none; d=zoho.com; s=zohoarc; b=S5eoMiH0aWatvvTA+xtgK27cBl/BmjeAe4DFbZ5lKd46hfUG8qnuL7BGa//nD3nrFzzbY+jxF2TwS/WGku52ewxWsQGD/XptA62g+nb484BfRirvbYWxKjiWN+bc6MwbZy7C3Ig1d4WzxrBvX0/CbjuXWGIgzYOpHT8mE5SN4bk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555521185; h=Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=HMdOGfkMITn55ZGrbszJbXEXc/F3CAYATI1wT9Eu/Xs=; b=TEtEy5kq4loSydk5wfMtP7vOKUajLVh8xMttNLjK+ZrWOfr01wnM3X9f4zQzkjf0JU/+Wx+xHqeBU+DRvqC0lkguoyAFlJ+0xW3biLnsEIm5KLgRDChNnuUn+1+GFkcU8pEpi0k9yhbK01/KUFu02i0AB37z11VNAMsHaQhZOSA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1555521185968883.2672611339794; Wed, 17 Apr 2019 10:13:05 -0700 (PDT) Received: from localhost ([127.0.0.1]:56880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGo7L-0000NO-UZ for importer@patchew.org; Wed, 17 Apr 2019 13:13:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGo5U-0007YI-90 for qemu-devel@nongnu.org; Wed, 17 Apr 2019 13:11:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGo5T-0007TE-Di for qemu-devel@nongnu.org; Wed, 17 Apr 2019 13:11:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36769) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hGo5R-0007QZ-AQ; Wed, 17 Apr 2019 13:11:05 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 75CD23086220; Wed, 17 Apr 2019 17:11:04 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-103.phx2.redhat.com [10.3.116.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id D936719C58; Wed, 17 Apr 2019 17:11:03 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Wed, 17 Apr 2019 12:11:00 -0500 Message-Id: <20190417171101.1254-2-eblake@redhat.com> In-Reply-To: <20190417171101.1254-1-eblake@redhat.com> References: <20190417171101.1254-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 17 Apr 2019 17:11:04 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 1/2] cutils: Fix size_to_str() on 32-bit platforms X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-stable@nongnu.org, qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" When extracting a human-readable size formatter, we changed 'uint64_t div' pre-patch to 'unsigned long div' post-patch. Which breaks on 32-bit platforms, resulting in 'inf' instead of intended values larger than 999GB. Fixes: 22951aaa CC: qemu-stable@nongnu.org Reported-by: Max Reitz Signed-off-by: Eric Blake Reviewed-by: Max Reitz --- util/cutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cutils.c b/util/cutils.c index e098debdc0c..d682c909015 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -825,7 +825,7 @@ const char *qemu_ether_ntoa(const MACAddr *mac) char *size_to_str(uint64_t val) { static const char *suffixes[] =3D { "", "Ki", "Mi", "Gi", "Ti", "Pi", = "Ei" }; - unsigned long div; + uint64_t div; int i; /* --=20 2.20.1