[PATCH 1/5] Crash if zero data but non-zero fd's in message

Bill Spitzak spitzak at gmail.com
Mon Mar 19 21:38:18 PDT 2012


Any comments on this patch? This really did fix a pretty major bug for me.

The other patches in this set are much less important but I thought it a 
good idea to send everything else I did while trying to debug this. I 
suspect my changes to EAGAIN are incorrect, however, so ignore them.

On 03/18/2012 10:56 PM, spitzak at gmail.com wrote:
> From: Bill Spitzak<spitzak at lulu.(none)>
>
> connection.c sent a 4096 byte block of garbage if it wanted to send an
> fd and there happened to be zero data to send as well.
> ---
>   src/connection.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/src/connection.c b/src/connection.c
> index fa01545..1f707ed 100644
> --- a/src/connection.c
> +++ b/src/connection.c
> @@ -124,6 +124,10 @@ wl_buffer_get_iov(struct wl_buffer *b, struct iovec *iov, int *count)
>   {
>   	int head, tail;
>
> +	if (b->head == b->tail) {
> +		*count = 0;
> +		return;
> +	}
>   	head = MASK(b->head);
>   	tail = MASK(b->tail);
>   	if (tail<  head) {



More information about the wayland-devel mailing list