[sr-dev] git:master:b933550a: topos: proper check if the last char in headr value is eol
Daniel-Constantin Mierla
miconda at gmail.com
Tue Sep 6 13:05:53 CEST 2016
Module: kamailio
Branch: master
Commit: b933550a50d61534747e97ce5031c18c4c12f1eb
URL: https://github.com/kamailio/kamailio/commit/b933550a50d61534747e97ce5031c18c4c12f1eb
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at 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/b933550a50d61534747e97ce5031c18c4c12f1eb.diff
Patch: https://github.com/kamailio/kamailio/commit/b933550a50d61534747e97ce5031c18c4c12f1eb.patch
---
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;
More information about the sr-dev
mailing list