Module: sip-router
Branch: master
Commit: 866ddc109bfd7c681e13ce529d271e8a2a33a972
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=866ddc1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Oct 10 12:19:29 2014 +0200
core: safety check for server_header lenght
- don't add the header in local generated replies if the value is empty
---
msg_translator.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/msg_translator.c b/msg_translator.c
index eb7acfc..6f36492 100644
--- a/msg_translator.c
+++ b/msg_translator.c
@@ -2398,7 +2398,7 @@ char * build_res_buf_from_sip_req( unsigned int code, str *text ,str
*new_tag,
body = lump;
}
/* server header */
- if (server_signature)
+ if (server_signature && server_hdr.len)
len += server_hdr.len + CRLF_LEN;
/* warning hdr */
if (sip_warning) {
@@ -2536,7 +2536,7 @@ char * build_res_buf_from_sip_req( unsigned int code, str *text ,str
*new_tag,
p += lump->text.len;
}
/* server header */
- if (server_signature) {
+ if (server_signature && server_hdr.len>0) {
memcpy( p, server_hdr.s, server_hdr.len );
p+=server_hdr.len;
memcpy( p, CRLF, CRLF_LEN );