Explorar o código

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

- reported by Kevin Wojtysiak
Daniel-Constantin Mierla %!s(int64=12) %!d(string=hai) anos
pai
achega
28a8b87885
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      modules/rr/loose.c

+ 1 - 1
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;