Browse Source

Merge pull request #1213 from christoph-v/ims_get_body_coredump

ims_auth: fixed rare core dump, due to null ptr check
ng-voice GmbH 8 năm trước cách đây
mục cha
commit
125db2c365
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      src/modules/ims_auth/utils.c

+ 3 - 1
src/modules/ims_auth/utils.c

@@ -204,7 +204,9 @@ str ims_get_body(struct sip_msg * msg)
 		LM_DBG("Error parsing until header Content-Length: \n");
 		return x;
 	}
-	x.len = (int)(long)msg->content_length->parsed;
+	if (msg->content_length)
+	    // Content-Length header might be missing
+	    x.len = (int)(long)msg->content_length->parsed;
         
         if (x.len>0) 
             x.s = get_body(msg);