[sr-dev] git:master: xhttp: safety checks for null parameter values

Daniel-Constantin Mierla miconda at gmail.com
Fri Dec 31 00:43:39 CET 2010


Module: sip-router
Branch: master
Commit: b5866451f323aa892bb48ba86424d6a45d8108b5
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b5866451f323aa892bb48ba86424d6a45d8108b5

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri Dec 31 00:40:32 2010 +0100

xhttp: safety checks for null parameter values

---

 modules/xhttp/xhttp_mod.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/xhttp/xhttp_mod.c b/modules/xhttp/xhttp_mod.c
index 22ebcc4..1c5ff7e 100644
--- a/modules/xhttp/xhttp_mod.c
+++ b/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)
 		{




More information about the sr-dev mailing list