- 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
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user