The buffer could change inside smartcard_read_buf_prepare. Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> --- server/smartcard.c | 1 + 1 file changed, 1 insertion(+) diff --git a/server/smartcard.c b/server/smartcard.c index d62847d60..961633f0e 100644 --- a/server/smartcard.c +++ b/server/smartcard.c @@ -151,6 +151,7 @@ static RedPipeItem *smartcard_read_msg_from_device(RedCharDevice *self, continue; } smartcard_read_buf_prepare(dev, vheader); + vheader = (VSCMsgHeader*)dev->priv->buf; } actual_length = ntohl(vheader->length); if (dev->priv->buf_used - sizeof(VSCMsgHeader) < actual_length) { -- 2.21.0 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel