From 9d951b010006ecd49b6765abbe59a2d9bd61e4ad Mon Sep 17 00:00:00 2001 From: Bogdan-Andrei Iancu Date: Wed, 15 Oct 2014 11:00:25 +0300 Subject: [PATCH] Compatibility fix for add_body() with new body. When computing the new content-len, accept the case when there is no pre-existing body and a newly added body. Reported by Antonis Psaras via LinkedIn (cherry picked from commit 8054dbfb4d0c5c621d35db6bc886da41d3a05294) Conflicts: msg_translator.c --- msg_translator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msg_translator.c b/msg_translator.c index ddb6756a58..0edff07133 100644 --- a/msg_translator.c +++ b/msg_translator.c @@ -326,8 +326,8 @@ char* clen_builder(struct sip_msg* msg, int *clen_len, int diff) char *buf, * value_s; int len, value, value_len; str body; - - if ( (get_body(msg,&body)!=0) || body.len==0 ) { + + if ( (get_body(msg,&body)!=0) ) { ser_error=E_BAD_REQ; LM_ERR("no message body found (missing crlf?)"); return 0;