Already limited using MIN statement. --- server/websocket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/websocket.c b/server/websocket.c index 8e6166f..d35a892 100644 --- a/server/websocket.c +++ b/server/websocket.c @@ -209,7 +209,7 @@ static int relay_data(guint8* buf, size_t size, websocket_frame_t *frame) int n = MIN(size, frame->expected_len - frame->relayed); if (frame->masked) { - for (i = 0; i < n && frame->relayed < frame->expected_len; i++, frame->relayed++) + for (i = 0; i < n; i++, frame->relayed++) *buf++ ^= frame->mask[frame->relayed % 4]; } -- 2.7.4 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel