Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: nf_conntrack_sip: fix ct_sip_parse_request() REGISTER request parsing

When requests are parsed, the "sip:" part of the SIP URI should be skipped.

Usually this doesn't matter because address parsing skips forward until after
the username part, but in case REGISTER requests it doesn't contain a username
and the address can not be parsed.

Signed-off-by: Patrick McHardy <kaber@trash.net>

+4 -3
+4 -3
net/netfilter/nf_conntrack_sip.c
··· 236 236 return 0; 237 237 238 238 /* Find SIP URI */ 239 - limit -= strlen("sip:"); 240 - for (; dptr < limit; dptr++) { 239 + for (; dptr < limit - strlen("sip:"); dptr++) { 241 240 if (*dptr == '\r' || *dptr == '\n') 242 241 return -1; 243 - if (strnicmp(dptr, "sip:", strlen("sip:")) == 0) 242 + if (strnicmp(dptr, "sip:", strlen("sip:")) == 0) { 243 + dptr += strlen("sip:"); 244 244 break; 245 + } 245 246 } 246 247 if (!skp_epaddr_len(ct, dptr, limit, &shift)) 247 248 return 0;