[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] ccid-card-passthru: check buffer size parameter
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] ccid-card-passthru: check buffer size parameter |
Date: |
Thu, 11 Oct 2018 14:34:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 11/10/2018 14:29, P J P wrote:
> +-- On Thu, 11 Oct 2018, Philippe Mathieu-Daudé wrote --+
> | The IOReadHandler does not have documentation.
> |
> | typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
> |
> | Why is the 'size' argument signed? Does it makes sens to call it with a
> | negative value?
>
> No, it doesn't IMO. I had first changed argument type 'int' to uint32_t'.
> as
>
> typedef void IOReadHandler(void *opaque, const uint8_t *buf, uint32_t size);
>
> But 'IOReadHandler' is registered and called from multiple char devices,
> which lead to compile time errors. As the function prototype changed.
>
> I'll update them all, if the above change is okay.
Yes, please do so.
Paolo
> Thank you.
> --
> Prasad J Pandit / Red Hat Product Security Team
> 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
>