[PATCH wayland] connection: Fix broken log message when demarshalling short closure

Pekka Paalanen ppaalanen at gmail.com
Thu Feb 15 07:27:10 UTC 2018


On Wed, 14 Feb 2018 12:15:11 -0600
Derek Foreman <derekf at osg.samsung.com> wrote:

> Like the similar wl_log() message further into this function that was
> fixed in commit 2fc248dc2c877d02694db40aad52180d71373d5a this should
> be printing the sender_id saved earlier instead of *p.
> 
> Since p is incremented during the loop it would not only print an
> incorrect object id, it could read past the end of the array.
> 
> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
> ---
>  src/connection.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/connection.c b/src/connection.c
> index 5d5711f..294c521 100644
> --- a/src/connection.c
> +++ b/src/connection.c
> @@ -710,7 +710,8 @@ wl_connection_demarshal(struct wl_connection *connection,
>  		if (arg.type != 'h' && p + 1 > end) {
>  			wl_log("message too short, "
>  			       "object (%d), message %s(%s)\n",
> -			       *p, message->name, message->signature);
> +			       closure->sender_id, message->name,
> +			       message->signature);
>  			errno = EINVAL;
>  			goto err;
>  		}

Hi,

nice catch. R-b me and pushed:
   9fa6098..68398ec  master -> master


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180215/416892c6/attachment.sig>


More information about the wayland-devel mailing list