[sr-dev] git:master:3be41802: xcap_server: shorten a bit the search range for xcaps_xpath_hack()

Daniel-Constantin Mierla miconda at gmail.com
Tue Oct 27 09:36:56 CET 2020


Module: kamailio
Branch: master
Commit: 3be41802c7c670cce0d3e08462e23ca3f3fbe2d4
URL: https://github.com/kamailio/kamailio/commit/3be41802c7c670cce0d3e08462e23ca3f3fbe2d4

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-10-27T09:36:38+01:00

xcap_server: shorten a bit the search range for xcaps_xpath_hack()

- match on the buffer len min size, xmlns is expected to have a value,
plus the ending of the xml tag

---

Modified: src/modules/xcap_server/xcap_server.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3be41802c7c670cce0d3e08462e23ca3f3fbe2d4.diff
Patch: https://github.com/kamailio/kamailio/commit/3be41802c7c670cce0d3e08462e23ca3f3fbe2d4.patch

---

diff --git a/src/modules/xcap_server/xcap_server.c b/src/modules/xcap_server/xcap_server.c
index 1556aa14b9..5c1ca9004b 100644
--- a/src/modules/xcap_server/xcap_server.c
+++ b/src/modules/xcap_server/xcap_server.c
@@ -322,7 +322,7 @@ int xcaps_xpath_hack(str *buf, int type)
 
 	start = buf->s;
 	STR_VTOZ(buf->s[buf->len-1], c);
-	while((start < buf->s + buf->len - 8) && (p = strstr(start, match))!=NULL) {
+	while((start < buf->s + buf->len - 10) && (p = strstr(start, match))!=NULL) {
 		memcpy(p, repl, 7);
 		start = p + 7;
 	}




More information about the sr-dev mailing list