diff --git a/src/core/crc.c b/src/core/crc.c index 4628463245f..23b2876ecf2 100644 --- a/src/core/crc.c +++ b/src/core/crc.c @@ -231,6 +231,8 @@ void crcitt_string_array( char *dst, str src[], int size ) ccitt = 0xFFFF; str_len=CRC16_LEN; for (i=0; is[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;