netfilter: nf_conntrack_sip: don't use strtoul_simple
Probably 'safe' because struct shinfo is stored at end of linear data area
and simple_strotul bails out on first character thats not a number.
Prefer a stricter version instead. There are intentional changes:
- Bail out if number is > UINT_MAX and indicate a failure.
We don't expect huge values here.
- Bail out if we get more characters than expected, we don't expect
something like 'expires=9999999999999999999999999999999999'.
- In ct_sip_parse_numerical_param() base 10 is enforced. This is used
to fetch 'expire=' and 'rports='; both are expected to be base-10 values.
- In nf_nat_sip.c, only accept the parsed value if its within the 1k-64k
range.
Signed-off-by: Florian Westphal <fw@strlen.de>
2 files changed