Skip to content

Commit

Permalink
netfilter: nf_conntrack_sip: fix off-by-one in compact header parsing
Browse files Browse the repository at this point in the history
In a string like "v:SIP/2.0..." it was checking for !isalpha('S') when it
meant to be inspecting the ':'.

Patch by Greg Alexander <greqcs@galexander.org>

Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Patrick McHardy committed Jan 19, 2010
1 parent dce766a commit 135d018
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_conntrack_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ int ct_sip_get_header(const struct nf_conn *ct, const char *dptr,
dptr += hdr->len;
else if (hdr->cname && limit - dptr >= hdr->clen + 1 &&
strnicmp(dptr, hdr->cname, hdr->clen) == 0 &&
!isalpha(*(dptr + hdr->clen + 1)))
!isalpha(*(dptr + hdr->clen)))
dptr += hdr->clen;
else
continue;
Expand Down

0 comments on commit 135d018

Please sign in to comment.