Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Markus Armbruster
mdroth writes: > On Wed, Feb 06, 2013 at 09:14:12PM +0100, Markus Armbruster wrote: >> mdroth writes: >> >> > On Wed, Feb 06, 2013 at 10:06:03AM +0100, Markus Armbruster wrote: [...] >> >> -- >> >> in : 1 >> >> out: >> >> b64: >> >> in : 1= >> >> out: >> >> b64: >> >> in : 1== >> >> out:

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread mdroth
On Wed, Feb 06, 2013 at 09:14:12PM +0100, Markus Armbruster wrote: > mdroth writes: > > > On Wed, Feb 06, 2013 at 10:06:03AM +0100, Markus Armbruster wrote: > >> Markus Armbruster writes: > >> > >> > Eric Blake writes: > >> > > >> >> On 02/05/2013 09:22 AM, Markus Armbruster wrote: > >> >>> Co

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Markus Armbruster
mdroth writes: > On Wed, Feb 06, 2013 at 10:06:03AM +0100, Markus Armbruster wrote: >> Markus Armbruster writes: >> >> > Eric Blake writes: >> > >> >> On 02/05/2013 09:22 AM, Markus Armbruster wrote: >> >>> Command memchar-write takes data and size parameter. Begs the >> >>> question what hap

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread mdroth
On Wed, Feb 06, 2013 at 10:06:03AM +0100, Markus Armbruster wrote: > Markus Armbruster writes: > > > Eric Blake writes: > > > >> On 02/05/2013 09:22 AM, Markus Armbruster wrote: > >>> Command memchar-write takes data and size parameter. Begs the > >>> question what happens when data doesn't mat

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Markus Armbruster
Luiz Capitulino writes: > On Wed, 06 Feb 2013 14:51:44 +0100 > Markus Armbruster wrote: > >> Back to your question, namely how to document enumeration DataFormat. >> Perhaps: >> >> ## >> # @DataFormat: >> # >> # An enumeration of data format. >> # >> # @utf8: Data is a UTF-8 string (RFC 3629) >

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Luiz Capitulino
On Wed, 06 Feb 2013 14:51:44 +0100 Markus Armbruster wrote: > Back to your question, namely how to document enumeration DataFormat. > Perhaps: > > ## > # @DataFormat: > # > # An enumeration of data format. > # > # @utf8: Data is a UTF-8 string (RFC 3629) > # > # @base64: Data is a Base64 encoded

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Luiz Capitulino
On Wed, 06 Feb 2013 10:06:03 +0100 Markus Armbruster wrote: > Markus Armbruster writes: > > > Eric Blake writes: > > > >> On 02/05/2013 09:22 AM, Markus Armbruster wrote: > >>> Command memchar-write takes data and size parameter. Begs the > >>> question what happens when data doesn't match si

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Markus Armbruster
Peter Maydell writes: > On 6 February 2013 09:06, Markus Armbruster wrote: >> As far as I can tell, it never fails, but silently ignores characters >> outside the alphabet [A-Za-z0-9+/] > > This bit at least is required behaviour: see RFC2045 section 6.8: > >Any characters outside of the bas

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Markus Armbruster
Luiz Capitulino writes: > On Tue, 5 Feb 2013 17:22:04 +0100 > Markus Armbruster wrote: > >> Command memchar-write takes data and size parameter. Begs the >> question what happens when data doesn't match size. >> >> With format base64, qmp_memchar_write() copies the full data argument, >> rega

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Peter Maydell
On 6 February 2013 09:06, Markus Armbruster wrote: > As far as I can tell, it never fails, but silently ignores characters > outside the alphabet [A-Za-z0-9+/] This bit at least is required behaviour: see RFC2045 section 6.8: Any characters outside of the base64 alphabet are to be ignored in

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Luiz Capitulino
On Wed, 06 Feb 2013 14:11:10 +0100 Markus Armbruster wrote: > Luiz Capitulino writes: > > > On Wed, 06 Feb 2013 10:06:03 +0100 > > Markus Armbruster wrote: > > > >> Markus Armbruster writes: > >> > >> > Eric Blake writes: > >> > > >> >> On 02/05/2013 09:22 AM, Markus Armbruster wrote: > >>

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Luiz Capitulino
On Tue, 5 Feb 2013 17:22:04 +0100 Markus Armbruster wrote: > Command memchar-write takes data and size parameter. Begs the > question what happens when data doesn't match size. > > With format base64, qmp_memchar_write() copies the full data argument, > regardless of size argument. > > With f

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Markus Armbruster
Luiz Capitulino writes: > On Wed, 06 Feb 2013 10:06:03 +0100 > Markus Armbruster wrote: > >> Markus Armbruster writes: >> >> > Eric Blake writes: >> > >> >> On 02/05/2013 09:22 AM, Markus Armbruster wrote: >> >>> Command memchar-write takes data and size parameter. Begs the >> >>> question w

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-06 Thread Markus Armbruster
Markus Armbruster writes: > Eric Blake writes: > >> On 02/05/2013 09:22 AM, Markus Armbruster wrote: >>> Command memchar-write takes data and size parameter. Begs the >>> question what happens when data doesn't match size. >>> >>> With format base64, qmp_memchar_write() copies the full data ar

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-05 Thread Eric Blake
On 02/05/2013 09:22 AM, Markus Armbruster wrote: > Command memchar-write takes data and size parameter. Begs the > question what happens when data doesn't match size. > > With format base64, qmp_memchar_write() copies the full data argument, > regardless of size argument. > > With format utf8, q

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-05 Thread Markus Armbruster
Eric Blake writes: > On 02/05/2013 09:22 AM, Markus Armbruster wrote: >> Command memchar-write takes data and size parameter. Begs the >> question what happens when data doesn't match size. >> >> With format base64, qmp_memchar_write() copies the full data argument, >> regardless of size argume

[Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-05 Thread Markus Armbruster
Command memchar-write takes data and size parameter. Begs the question what happens when data doesn't match size. With format base64, qmp_memchar_write() copies the full data argument, regardless of size argument. With format utf8, qmp_memchar_write() copies size bytes from data, happily reading