[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 05/19] cutils: Fix wraparound parsing in qemu_strtoui
From: |
Eric Blake |
Subject: |
Re: [PATCH v2 05/19] cutils: Fix wraparound parsing in qemu_strtoui |
Date: |
Thu, 18 May 2023 08:34:51 -0500 |
User-agent: |
NeoMutt/20230517 |
On Thu, May 11, 2023 at 09:10:19PM -0500, Eric Blake wrote:
>
> While we were matching 32-bit strtol in qemu_strtoi, our use of a
> 64-bit parse was leaking through for some inaccurate answers in
> qemu_strtoui in comparison to a 32-bit strtoul. Fix those, and update
> the testsuite now that our bounds checks are correct.
>
> Our int wrappers would be a lot easier to write if libc had a
> guaranteed 32-bit parser even on platforms with 64-bit long.
>
> Fixes: 473a2a331e ("cutils: add qemu_strtoi & qemu_strtoui parsers for
> int/unsigned int types", v2.12.0)
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> tests/unit/test-cutils.c | 11 +++++------
> util/cutils.c | 14 ++++++++++----
> 2 files changed, 15 insertions(+), 10 deletions(-)
cc'ing qemu-stable as this is a bug fix, but given its age, it's not a
recent regression and therefore probably not essential for backport
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v2 05/19] cutils: Fix wraparound parsing in qemu_strtoui,
Eric Blake <=