ct_sip_parse_numerical_param can only return 0 or 1, but the caller is
checking parsing error using < 0
Signed-off-by: Tong Zhang <redacted>
---
net/netfilter/nf_conntrack_sip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Pablo Neira Ayuso <pablo@netfilter.org> Date: 2020-08-28 18:07:53
On Sat, Aug 15, 2020 at 12:50:30PM -0400, Tong Zhang wrote:
ct_sip_parse_numerical_param can only return 0 or 1, but the caller is
checking parsing error using < 0
Is this are real issue in your setup or probably some static analysis
tool is reporting?
You are right that ct_sip_parse_numerical_param() never returns < 0,
however, looking at:
https://tools.ietf.org/html/rfc3261 see Page 161
expires is optional, my understanding is that your patch is making
this option mandatory.
Hi Pablo,
I'm not an expert in this networking stuff.
But from my point of view there's no point in checking if this
condition is always true.
There's also no need of returning anything from the
ct_sip_parse_numerical_param()
if they are all being ignored like this.
On Fri, Aug 28, 2020 at 2:07 PM Pablo Neira Ayuso [off-list ref] wrote:
Is this are real issue in your setup or probably some static analysis
tool is reporting?
You are right that ct_sip_parse_numerical_param() never returns < 0,
however, looking at:
https://tools.ietf.org/html/rfc3261 see Page 161
expires is optional, my understanding is that your patch is making
this option mandatory.
I think the original code complaining parsing error is there for a reason,
A better way is to modify ct_sip_parse_numerical_param() and let it return
a real parsing error code instead of returning FOUND(1) and NOT FOUND(0)
if deemed necessary
Once again I'm not an expert and I'm may suggest something stupid,
please pardon my ignorance --
- Tong
On Fri, Aug 28, 2020 at 2:19 PM Pablo Neira Ayuso [off-list ref] wrote:
Then probably update this code to ignore the return value?