From c39bb18469e58751167cbf280d9318ea405fb912 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Thu, 2 Dec 2021 13:47:09 +0000 Subject: [PATCH] Fix buffer size check --- libxrdp/xrdp_rdp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c index a48fbaa2..c2b23289 100644 --- a/libxrdp/xrdp_rdp.c +++ b/libxrdp/xrdp_rdp.c @@ -816,6 +816,9 @@ xrdp_rdp_send_fastpath(struct xrdp_rdp *self, struct stream *s, updateHeader = (updateCode & 15) | ((fragmentation & 3) << 4) | ((compression & 3) << 6); + + send_s.end = send_s.p + send_len; + send_s.size = send_s.end - send_s.data; out_uint8(&send_s, updateHeader); if (compression != 0) { @@ -824,7 +827,6 @@ xrdp_rdp_send_fastpath(struct xrdp_rdp *self, struct stream *s, } send_len -= header_bytes; out_uint16_le(&send_s, send_len); - send_s.end = send_s.p + send_len; LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] TS_FP_UPDATE " "updateCode %d, fragmentation %d, compression %d, compressionFlags %s, size %d", updateCode, fragmentation, compression,