Browse code

ipops: fix locating static index for dns pv

- reported by GH #2179

Daniel-Constantin Mierla authored on 07/01/2020 09:11:42
Showing 1 changed files
... ...
@@ -190,7 +190,7 @@ int pv_parse_dns_name(pv_spec_t *sp, str *in)
190 190
 			goto error;
191 191
 		}
192 192
 		pvi.s = p + 1;
193
-		pvi.len = pvs.s + pvs.len - pvi.s;
193
+		pvi.len = pvs.s + pvs.len - 1 - pvi.s;
194 194
 		pvs.len = p - pvs.s;
195 195
 	}
196 196
 	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)
246 246
 			}
247 247
 			if(p!=pvi.s+pvi.len)
248 248
 			{
249
-				LM_ERR("invalid index [%.*s]\n", in->len, in->s);
249
+				LM_ERR("invalid index [%.*s] in [%.*s]\n", pvi.len, pvi.s,
250
+						in->len, in->s);
250 251
 				goto error;
251 252
 			}
252 253
 			dpv->nidx *= sign;