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@xxxxxxxxxx>
Acked-by: Uri Lublin <uril@xxxxxxxxxx>
--- 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;
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel