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

Daniel-Constantin Mierla miconda at gmail.com
Sat Apr 13 15:46:25 CEST 2013


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Apr  9 00:15:47 2013 +0200

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

- reported by Kevin Wojtysiak
(cherry picked from commit 28a8b87885e373bee8cc81985277ae718973fdfd)

---

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

diff --git a/modules/rr/loose.c b/modules/rr/loose.c
index 268522c..ccd08d9 100644
--- a/modules/rr/loose.c
+++ b/modules/rr/loose.c
@@ -367,7 +367,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