diff options
author | rrs <rrs@FreeBSD.org> | 2007-06-22 14:40:09 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2007-06-22 14:40:09 +0000 |
commit | aaa3e960bf1d377a59c812b0fe62a7f8ee229227 (patch) | |
tree | 639505c34668c57527d879c780a1976456a020f7 | |
parent | 689929ef2e024d9912f76db5d23e2e2aaa68e39a (diff) | |
download | FreeBSD-src-aaa3e960bf1d377a59c812b0fe62a7f8ee229227.zip FreeBSD-src-aaa3e960bf1d377a59c812b0fe62a7f8ee229227.tar.gz |
- 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)
-rw-r--r-- | sys/netinet/sctp_input.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |