Module: sip-router
Branch: master
Commit: 643189177d93b5036beda2481457e079a451c512
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6431891…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Thu Apr 23 13:45:56 2009 +0200
port from branch 1.5, r5802
fix crash when no content-length is present, related to bug #2753152
---
modules_k/nathelper/nhelpr_funcs.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/modules_k/nathelper/nhelpr_funcs.c b/modules_k/nathelper/nhelpr_funcs.c
index 1df4c53..788153c 100644
--- a/modules_k/nathelper/nhelpr_funcs.c
+++ b/modules_k/nathelper/nhelpr_funcs.c
@@ -169,6 +169,11 @@ int extract_body(struct sip_msg *msg, str *body )
* parcing as get_body() parsed all headers and Conten-Length
* body header is automaticaly parsed when found.
*/
+ if (msg->content_length==0) {
+ LM_ERR("failed to get the content length in message\n");
+ goto error;
+ }
+
body->len = get_content_length(msg);
if (body->len==0) {
LM_ERR("message body has length zero\n");