Browse Source

xhttp: safety checks for null parameter values

Daniel-Constantin Mierla 14 years ago
parent
commit
b5866451f3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      modules/xhttp/xhttp_mod.c

+ 2 - 2
modules/xhttp/xhttp_mod.c

@@ -362,7 +362,7 @@ static int xhttp_send_reply(sip_msg_t *msg, int code, str *reason,
 {
 	str tbuf;
 
-	if(ctype->len>0)
+	if(ctype!=NULL && ctype->len>0)
 	{
 		/* add content-type */
 		tbuf.len=sizeof("Content-Type: ") - 1 + ctype->len + CRLF_LEN;
@@ -386,7 +386,7 @@ static int xhttp_send_reply(sip_msg_t *msg, int code, str *reason,
 		pkg_free(tbuf.s);
 	}
 
-	if(body->len>0)
+	if(body!=NULL && body->len>0)
 	{
 		if (add_lump_rpl(msg, body->s, body->len, LUMP_RPL_BODY) < 0)
 		{