summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2006-05-02 23:36:01 +0000
committerjsorg71 <jsorg71>2006-05-02 23:36:01 +0000
commitbff658c96bdd7cf0986995ef262f363f4320e681 (patch)
tree0712311e2aeca9589a3d09ae75f1cc8c6d2a247f
parent770a27bfb39a64cb742f73156cfb1071fe8fd603 (diff)
downloadxrdp-proprietary-bff658c96bdd7cf0986995ef262f363f4320e681.tar.gz
xrdp-proprietary-bff658c96bdd7cf0986995ef262f363f4320e681.zip
fix for large clip data
-rw-r--r--vnc/vnc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/vnc/vnc.c b/vnc/vnc.c
index b0c6b295..e18ffd45 100644
--- a/vnc/vnc.c
+++ b/vnc/vnc.c
@@ -616,6 +616,7 @@ lib_clip_data(struct vnc* v)
struct stream* s;
int size;
int error;
+ int temp;
make_stream(s);
init_stream(s, 8192);
@@ -624,8 +625,17 @@ lib_clip_data(struct vnc* v)
{
in_uint8s(s, 3);
in_uint32_be(s, size);
- init_stream(s, 8192);
- error = lib_recv(v, s->data, size);
+ while (size > 0 && error == 0)
+ {
+ init_stream(s, 8192);
+ temp = size;
+ if (temp > 8192)
+ {
+ temp = 8192;
+ }
+ error = lib_recv(v, s->data, temp);
+ size -= temp;
+ }
}
free_stream(s);
return error;