[Spice-devel] [PATCH spice-server 7/9] reds: Fix wrong assert

Uri Lublin uril at redhat.com
Tue Dec 5 12:29:15 UTC 2017


On 12/05/2017 10:41 AM, Frediano Ziglio wrote:
> RedVDIReadBuf::data is a static allocated buffer so checking for
> NULL on it is useless. It would be NULL only if RedVDIReadBuf
> pointer would be the opposite, in value, of the offset of
> data field into it.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

Acked-by: Uri Lublin <uril at redhat.com>

> ---
> Maybe this check should just be removed?
I think it can be removed.

Thanks,
     Uri.


> ---
>   server/reds.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/reds.c b/server/reds.c
> index ab41244c..f5b9ffd2 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -1239,7 +1239,7 @@ void reds_on_main_channel_migrate(RedsState *reds, MainChannelClient *mcc)
>       if (agent_dev->priv->read_state != VDI_PORT_READ_STATE_READ_DATA) {
>           return;
>       }
> -    spice_assert(agent_dev->priv->current_read_buf->data &&
> +    spice_assert(agent_dev->priv->current_read_buf &&
>                    agent_dev->priv->receive_pos > agent_dev->priv->current_read_buf->data);
>       read_data_len = agent_dev->priv->receive_pos - agent_dev->priv->current_read_buf->data;
>   
> 



More information about the Spice-devel mailing list