mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-12 16:11:04 +00:00
[NETFILTER]: SIP conntrack: fix skipping over user info in SIP headers
When trying to skip over the username in the Contact header, stop at the end of the line if no @ is found to avoid mangling following headers. We don't need to worry about continuation lines because we search inside a SIP URI. Fixes Netfilter Bugzilla #532. Signed-off-by: Lars Immisch <lars@ibp.de> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fb74a84160
commit
7da5bfbb12
@ -283,8 +283,14 @@ static int skp_epaddr_len(const char *dptr, const char *limit, int *shift)
|
|||||||
{
|
{
|
||||||
int s = *shift;
|
int s = *shift;
|
||||||
|
|
||||||
for (; dptr <= limit && *dptr != '@'; dptr++)
|
/* Search for @, but stop at the end of the line.
|
||||||
|
* We are inside a sip: URI, so we don't need to worry about
|
||||||
|
* continuation lines. */
|
||||||
|
while (dptr <= limit &&
|
||||||
|
*dptr != '@' && *dptr != '\r' && *dptr != '\n') {
|
||||||
(*shift)++;
|
(*shift)++;
|
||||||
|
dptr++;
|
||||||
|
}
|
||||||
|
|
||||||
if (*dptr == '@') {
|
if (*dptr == '@') {
|
||||||
dptr++;
|
dptr++;
|
||||||
|
@ -303,8 +303,14 @@ static int skp_epaddr_len(struct nf_conn *ct, const char *dptr,
|
|||||||
{
|
{
|
||||||
int s = *shift;
|
int s = *shift;
|
||||||
|
|
||||||
for (; dptr <= limit && *dptr != '@'; dptr++)
|
/* Search for @, but stop at the end of the line.
|
||||||
|
* We are inside a sip: URI, so we don't need to worry about
|
||||||
|
* continuation lines. */
|
||||||
|
while (dptr <= limit &&
|
||||||
|
*dptr != '@' && *dptr != '\r' && *dptr != '\n') {
|
||||||
(*shift)++;
|
(*shift)++;
|
||||||
|
dptr++;
|
||||||
|
}
|
||||||
|
|
||||||
if (*dptr == '@') {
|
if (*dptr == '@') {
|
||||||
dptr++;
|
dptr++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user