Browse code

tm: skip body operation on empty string for uac building

(cherry picked from commit 34b61d3f1d6b5a0d4425f8edfa69d707cfa058b7)
(cherry picked from commit d96e3527c20791cb2291aa91685d5bc85606eb56)

Daniel-Constantin Mierla authored on 09/09/2021 08:25:29
Showing 1 changed files
... ...
@@ -1632,7 +1632,7 @@ char* build_uac_req(str* method, str* headers, str* body, dlg_t* dialog,
1632 1632
 			memapp(w, CRLF, CRLF_LEN);
1633 1633
 	}
1634 1634
 	memapp(w, CRLF, CRLF_LEN);
1635
-	if (body) memapp(w, body->s, body->len);
1635
+	if (body && body->s && body->len>0) memapp(w, body->s, body->len);
1636 1636
 
1637 1637
 #ifdef EXTRA_DEBUG
1638 1638
 	assert(w-buf == *len);