mirror of https://github.com/sipwise/kamailio.git
Improve header safe guards for Via handling
Backported from kamailio version 5.1.
Original commit:
ad68e402ec
Change-Id: I6ab3dbe18f3c25157931e66d644405337efbb200
changes/41/23641/1
parent
94a0de573b
commit
13a08603fb
@ -0,0 +1,34 @@
|
||||
--- a/crc.c
|
||||
+++ b/crc.c
|
||||
@@ -231,6 +231,8 @@ void crcitt_string_array( char *dst, str
|
||||
ccitt = 0xFFFF;
|
||||
str_len=CRC16_LEN;
|
||||
for (i=0; i<size; i++ ) {
|
||||
+ /* invalid str with positive length and null char pointer */
|
||||
+ if( unlikely(src[i].s==NULL)) break;
|
||||
c=src[i].s;
|
||||
len=src[i].len;
|
||||
while(len) {
|
||||
--- a/msg_translator.c
|
||||
+++ b/msg_translator.c
|
||||
@@ -167,12 +167,17 @@ static int check_via_address(struct ip_a
|
||||
(name->s[name->len-1]==']')&&
|
||||
(strncasecmp(name->s+1, s, len)==0))
|
||||
)
|
||||
- )
|
||||
+ ) {
|
||||
return 0;
|
||||
- else
|
||||
-
|
||||
+ }
|
||||
+ else {
|
||||
+ if (unlikely(name->s==NULL)) {
|
||||
+ LM_CRIT("invalid Via host name\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
if (strncmp(name->s, s, name->len)==0)
|
||||
return 0;
|
||||
+ }
|
||||
}else{
|
||||
LM_CRIT("could not convert ip address\n");
|
||||
return -1;
|
Loading…
Reference in new issue