ソースを参照

port from branch 1.5, r5802

fix crash when no content-length is present, related to bug #2753152
Henning Westerholt 16 年 前
コミット
643189177d
1 ファイル変更5 行追加0 行削除
  1. 5 0
      modules_k/nathelper/nhelpr_funcs.c

+ 5 - 0
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");