From b36ad7b2d0b3a5d12a6ad72bd8cf0e502f819ac2 Mon Sep 17 00:00:00 2001 From: Denis Skvortsov Date: Mon, 27 Jul 2026 15:35:26 +0300 Subject: [PATCH] Cast to size_t in bounds macros; drop resulting dead check --- common/parse.h | 4 ++-- libxrdp/xrdp_mcs.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/parse.h b/common/parse.h index bef6bf31..297c9a18 100644 --- a/common/parse.h +++ b/common/parse.h @@ -186,7 +186,7 @@ unsigned int in_utf16_le_terminated_as_utf8_length(struct stream *s); /******************************************************************************/ -#define s_check_rem(s, n) ((n) <= (s)->end - (s)->p) +#define s_check_rem(s, n) ((size_t)(n) <= (size_t)((s)->end - (s)->p)) /******************************************************************************/ /** @@ -202,7 +202,7 @@ in_utf16_le_terminated_as_utf8_length(struct stream *s); && 0 ) /******************************************************************************/ -#define s_check_rem_out(s, n) ((n) <= (s)->size - ((s)->p - (s)->data)) +#define s_check_rem_out(s, n) ((size_t)(n) <= (size_t)((s)->size - ((s)->p - (s)->data))) /******************************************************************************/ /** diff --git a/libxrdp/xrdp_mcs.c b/libxrdp/xrdp_mcs.c index 84dd274d..962a5948 100644 --- a/libxrdp/xrdp_mcs.c +++ b/libxrdp/xrdp_mcs.c @@ -352,7 +352,7 @@ xrdp_mcs_parse_domain_params(struct xrdp_mcs *self, struct stream *s) in_uint8s(s, len); /* skip all fields */ - return !s_check_rem_and_log(s, 0, "Parsing [ITU-T T.125] DomainParameters"); + return 0; } /*****************************************************************************/