[sr-dev] git:3.2: rr: use port. len to check for buffer overflow instead of max port len

Henning Westerholt hw at kamailio.org
Fri Apr 19 11:05:09 CEST 2013


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

Author: Henning Westerholt <hw at kamailio.org>
Committer: Henning Westerholt <hw at kamailio.org>
Date:   Fri Apr 19 11:01:56 2013 +0200

rr: use port.len to check for buffer overflow instead of max port len

    - reported by Kevin Wojtysiak
    (from commit 28a8b87885e373bee8cc81985277ae718973fdfd)

---

 modules_k/rr/loose.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules_k/rr/loose.c b/modules_k/rr/loose.c
index 16cab74..3f19cc7 100644
--- a/modules_k/rr/loose.c
+++ b/modules_k/rr/loose.c
@@ -363,7 +363,7 @@ static inline int get_maddr_uri(str *uri, struct sip_uri *puri)
 		return 0;
 
 	/* sip: + maddr + : + port */
-	if( (puri->maddr_val.len) > (127 - 10) )
+	if( (puri->maddr_val.len) > (127 - 6 - puri->port.len) )
 	{
 		LM_ERR( "Too long maddr parameter\n");
 		return RR_ERROR;




More information about the sr-dev mailing list