Module: kamailio
Branch: master
Commit: b933550a50d61534747e97ce5031c18c4c12f1eb
URL:
https://github.com/kamailio/kamailio/commit/b933550a50d61534747e97ce5031c18…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-09-06T13:05:08+02:00
topos: proper check if the last char in headr value is eol
---
Modified: modules/topos/tps_msg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b933550a50d61534747e97ce5031c18…
Patch:
https://github.com/kamailio/kamailio/commit/b933550a50d61534747e97ce5031c18…
---
diff --git a/modules/topos/tps_msg.c b/modules/topos/tps_msg.c
index acca572..bdd3839 100644
--- a/modules/topos/tps_msg.c
+++ b/modules/topos/tps_msg.c
@@ -166,7 +166,7 @@ int tps_add_headers(sip_msg_t *msg, str *hname, str *hbody, int hpos)
memcpy(hs.s + hname->len + 2, hbody->s, hbody->len);
/* add end of header if not present */
- if(hs.s[hname->len + 2 + hbody->len]!='\n') {
+ if(hs.s[hname->len + 2 + hbody->len - 1]!='\n') {
hs.s[hname->len + 2 + hbody->len] = '\r';
hs.s[hname->len + 2 + hbody->len+1] = '\n';
hs.len += 2;