Cast to size_t in bounds macros; drop resulting dead check

This commit is contained in:
Denis Skvortsov
2026-07-27 15:35:26 +03:00
parent e4f4364c9b
commit b36ad7b2d0
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -186,7 +186,7 @@ unsigned int
in_utf16_le_terminated_as_utf8_length(struct stream *s); 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 ) && 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)))
/******************************************************************************/ /******************************************************************************/
/** /**
+1 -1
View File
@@ -352,7 +352,7 @@ xrdp_mcs_parse_domain_params(struct xrdp_mcs *self, struct stream *s)
in_uint8s(s, len); /* skip all fields */ in_uint8s(s, len); /* skip all fields */
return !s_check_rem_and_log(s, 0, "Parsing [ITU-T T.125] DomainParameters"); return 0;
} }
/*****************************************************************************/ /*****************************************************************************/