[spice-server,2/2] smartcard: Reset vheader value

Submitted by Frediano Ziglio on Oct. 10, 2019, 9:02 a.m.

Details

Message ID 20191010090234.10495-2-fziglio@redhat.com
State Accepted
Commit ebe676697f8727057a5c64ec06fd75ae92ccc56a
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Oct. 10, 2019, 9:02 a.m.
The buffer could change inside smartcard_read_buf_prepare.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/smartcard.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

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) {