diff --git a/src/modules/cplc/cpl_nonsig.c b/src/modules/cplc/cpl_nonsig.c index d87c02d18fa..ba53ee0ab67 100644 --- a/src/modules/cplc/cpl_nonsig.c +++ b/src/modules/cplc/cpl_nonsig.c @@ -230,11 +230,18 @@ void cpl_aux_process( int cmd_out, char *log_dir) LM_ERR("cannot set to IGNORE SIGCHLD signal\n"); } + file[0] = '\0'; + file_ptr = file; /* set the path for logging */ if (log_dir) { - strcpy( file, log_dir); - file_ptr = file + strlen(log_dir); - *(file_ptr++) = '/'; + if(strlen(log_dir)>=MAX_LOG_DIR_SIZE) { + /* fallback */ + LM_ERR("log dir path is too long, ignoring - check workdir\n"); + } else { + strcpy(file, log_dir); + file_ptr = file + strlen(log_dir); + *(file_ptr++) = '/'; + } } while(1) { diff --git a/src/modules/cplc/cpl_switches.h b/src/modules/cplc/cpl_switches.h index 4a99b2cbe4f..2accfd21b9a 100644 --- a/src/modules/cplc/cpl_switches.h +++ b/src/modules/cplc/cpl_switches.h @@ -873,6 +873,12 @@ inline static int is_lang_tag_matching(str *range,str *cpl_tag,str *cpl_subtag) str tag = {0,0}; str subtag = {0,0}; + if(range==NULL || cpl_tag==NULL || cpl_subtag==NULL) { + return -1; + } + if(range->s==NULL || cpl_tag->s==NULL || cpl_subtag->s==NULL) { + return -1; + } c = range->s; end = range->s + range->len;