qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function
Date: Mon, 26 May 2008 19:46:10 +0200


On May 25, 2008, at 12:38 PM, Carlo Marcelo Arenas Belon wrote:

Alexander

sorry if I wasn't clear enough. I wasn't arguing about your patch (which is correct) but was trying to explain why the old implementation was done the way it was, in an (obviously excessive) effort to prevent a buffer overflow for the response (which used to be hardcoded to 32 bytes regardless of the size of the
buffer) as shown by :

 http://svn.savannah.gnu.org/viewvc/trunk/hw/ide.c?root=qemu&r1=3147&r2=3161

a slightly modified version of your patch (which I'd been using against kvm
and validated correct with Linux and Solaris guests) attached.

the only difference, is that it handles explicitly the empty buffer case and
cleans up the len calculation which shouldn't had been calculated
conditionally as you pointed out.

Carlo
<kvm-69-qemu-ide-dvdrom.patch>


Hum ... it might be a good idea to inline patches so commenting on them is easier. You don't need to check for max_len > 0, because if max_len == 0 the packet will be truncated back to 0 bytes by ide_atapi_cmd_reply(s, len, max_len).

Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]