Skip to content

Commit

Permalink
ipops: fix locating static index for dns pv
Browse files Browse the repository at this point in the history
- reported by GH #2179

(cherry picked from commit a383caa)
  • Loading branch information
miconda committed Jan 8, 2020
1 parent 851e3f3 commit 2dc2743
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/ipops/ipops_pv.c
Expand Up @@ -190,7 +190,7 @@ int pv_parse_dns_name(pv_spec_t *sp, str *in)
goto error;
}
pvi.s = p + 1;
pvi.len = pvs.s + pvs.len - pvi.s;
pvi.len = pvs.s + pvs.len - 1 - pvi.s;
pvs.len = p - pvs.s;
}
LM_DBG("dns [%.*s] - key [%.*s] index [%.*s]\n", pvc.len, pvc.s,
Expand Down Expand Up @@ -246,7 +246,8 @@ int pv_parse_dns_name(pv_spec_t *sp, str *in)
}
if(p!=pvi.s+pvi.len)
{
LM_ERR("invalid index [%.*s]\n", in->len, in->s);
LM_ERR("invalid index [%.*s] in [%.*s]\n", pvi.len, pvi.s,
in->len, in->s);
goto error;
}
dpv->nidx *= sign;
Expand Down

0 comments on commit 2dc2743

Please sign in to comment.