> 
> Protocol states that name is an array of bytes but the marshallers are
> considering it a pointer to an array of bytes. A client that does not
> use demarshallers from spice-common will find an incorrect
> implementation of spice-server SpiceMsgPortInit.
> 
> Reported-by: Oliver Gutierrez <ogutier...@redhat.com>
> Signed-off-by: Pavel Grunt <pgr...@redhat.com>
> Signed-off-by: Victor Toso <victort...@redhat.com>
> ---
>  spice.proto | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/spice.proto b/spice.proto
> index 0bfc515..08d7152 100644
> --- a/spice.proto
> +++ b/spice.proto
> @@ -1412,7 +1412,7 @@ channel PortChannel : SpicevmcChannel {
>   server:
>      message {
>       uint32 name_size;
> -     uint8 *name[name_size] @zero_terminated @marshall @nonnull;
> +     uint8 name[name_size] @zero_terminated @marshall @nonnull;
>       uint8 opened;
>      } init = 201;
>      message {

We had some discussion on IRC.

Basically this message is changing the protocol format which obviously
breaks compatibility.
The "uint8 *name[name_size]" in the protocol means that there is a 4 byte
offset that points to a "uint8 name[name_size]", the message could be
something like
- name_size (4 bytes)
- offset of name (4 bytes)
- opened (1 bytes)
- name (name_size bytes)

Yes, it's complicated and using just a normal array would avoid the 4
bytes.

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to