From aaa3e960bf1d377a59c812b0fe62a7f8ee229227 Mon Sep 17 00:00:00 2001 From: rrs Date: Fri, 22 Jun 2007 14:40:09 +0000 Subject: - Fix type casts in calling sctp_m_getptr, it expects a int not an unsigned (returned by sizeof) also add cast to comparison check for size bounds. Approved by: re(bmah@freebsd.org) --- sys/netinet/sctp_input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/netinet/sctp_input.c') diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index e3d49bd..ad2f136 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -3122,11 +3122,11 @@ strres_nochunk: /* bad param */ break; } - ph = (struct sctp_paramhdr *)sctp_m_getptr(m, offset, min(param_len, sizeof(cstore)), + ph = (struct sctp_paramhdr *)sctp_m_getptr(m, offset, min(param_len, (int)sizeof(cstore)), (uint8_t *) & cstore); ptype = ntohs(ph->param_type); num_param++; - if (param_len > sizeof(cstore)) { + if (param_len > (int)sizeof(cstore)) { trunc = 1; } else { trunc = 0; -- cgit v1.1