[Spice-devel] [PATCH usbredir 8/8] Use a smaller buffer to Skip forward in error conditions.
Jeremy White
jwhite at codeweavers.com
Wed Dec 9 14:15:06 PST 2015
The kernel limits stack size to 2048, so using a large local
variable does not work there.
This only happens in error conditions, and should not make
a material difference to the non kernel cases.
Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
usbredirparser/usbredirparser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usbredirparser/usbredirparser.c b/usbredirparser/usbredirparser.c
index 6d8735d..7f5d586 100644
--- a/usbredirparser/usbredirparser.c
+++ b/usbredirparser/usbredirparser.c
@@ -955,7 +955,7 @@ int usbredirparser_do_read(struct usbredirparser *parser_pub)
/* Skip forward to next packet (only used in error conditions) */
while (parser->to_skip > 0) {
- uint8_t buf[65536];
+ uint8_t buf[512];
r = (parser->to_skip > sizeof(buf)) ? sizeof(buf) : parser->to_skip;
r = parser->callb.read_func(parser->callb.priv, buf, r);
if (r <= 0)
--
2.1.4
More information about the Spice-devel
mailing list