summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-09-05 16:25:13 +0200
committerHans de Goede <hdegoede@redhat.com>2013-09-05 16:31:48 +0200
commit931a41c1c92410639a0e76e6fdd07482f06e4578 (patch)
tree2043fbd1825eada95533e31db642b511b88bd3b8
parent64acef2fb9ee025042a95cb6512e93afcfe74831 (diff)
usbredirparser: Update header-len inside the usbredirparser_do_read loop
If we process the hello packet with the 64 bit id capability bit in the same loop as other packets (because they were send quickly after one each other), then we end up reading 48 bytes for the header of the next packets processed in the same loop, while we should read 64 bytes for them, causing the sender and receiver to get out of sync. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--usbredirparser/usbredirparser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usbredirparser/usbredirparser.c b/usbredirparser/usbredirparser.c
index b60d3f4..b50ddec 100644
--- a/usbredirparser/usbredirparser.c
+++ b/usbredirparser/usbredirparser.c
@@ -1011,6 +1011,8 @@ int usbredirparser_do_read(struct usbredirparser *parser_pub)
parser->data = NULL;
if (!r)
return -2;
+ /* header len may change if this was an hello packet */
+ header_len = usbredirparser_get_header_len(parser_pub);
}
}
}