Received: from eggs.gnu.org ([2001:4830:134:3::10]:43425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAaAn-0003ma-8G for qemu-devel@nongnu.org; Thu, 11 Oct 2018 08:34:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAaAm-0001Sl-Jg for qemu-devel@nongnu.org; Thu, 11 Oct 2018 08:34:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41702) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gAaAm-0001SR-Bl for qemu-devel@nongnu.org; Thu, 11 Oct 2018 08:34:36 -0400 References: <20181011112436.9305-1-ppandit@redhat.com> From: Paolo Bonzini Message-ID: <7569df8e-97e2-8488-ce91-9059428c2d29@redhat.com> Date: Thu, 11 Oct 2018 14:34:25 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] ccid-card-passthru: check buffer size parameter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: P J P , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Cc: QEMU Developers , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Gerd Hoffmann , Arash TC On 11/10/2018 14:29, P J P wrote: > +-- On Thu, 11 Oct 2018, Philippe Mathieu-Daud=C3=A9 wrote --+ > | The IOReadHandler does not have documentation. > |=20 > | typedef void IOReadHandler(void *opaque, const uint8_t *buf, int siz= e); > |=20 > | Why is the 'size' argument signed? Does it makes sens to call it with= a > | negative value? >=20 > No, it doesn't IMO. I had first changed argument type 'int' to uint32= _t'. > as >=20 > typedef void IOReadHandler(void *opaque, const uint8_t *buf, uint32_t= size); >=20 > But 'IOReadHandler' is registered and called from multiple char devices= ,=20 > which lead to compile time errors. As the function prototype changed. >=20 > 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 >=20