- 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)
This commit is contained in:
parent
a593094ea0
commit
a964e8de4c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170994
@ -3122,11 +3122,11 @@ __attribute__((noinline))
|
||||
/* 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;
|
||||
|
Loading…
Reference in New Issue
Block a user