Ver código fonte

ipops: fix locating static index for dns pv

- reported by GH #2179

(cherry picked from commit a383caa12a1af2cbc0f135add643045a159f24f2)
Daniel-Constantin Mierla 5 anos atrás
pai
commit
732f2c04cb
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      src/modules/ipops/ipops_pv.c

+ 3 - 2
src/modules/ipops/ipops_pv.c

@@ -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,
@@ -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;