Skip to content

Commit

Permalink
cpl_c: prevent possible buffer overflow
Browse files Browse the repository at this point in the history
Fixes Coverity CID #40882
  • Loading branch information
razvancrainea committed Jul 21, 2020
1 parent 8b410a7 commit ca75dae
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions modules/cpl_c/cpl_nonsig.c
Expand Up @@ -230,9 +230,15 @@ void cpl_aux_process( int cmd_out, char *log_dir)

/* set the path for logging */
if (log_dir) {
strcpy( file, log_dir);
file_ptr = file + strlen(log_dir);
*(file_ptr++) = '/';
len = strlen(log_dir);
if (len + 1 >= sizeof(file)) {
LM_ERR("log directory too long!\n");
file_ptr = log_dir;
} else {
strcpy( file, log_dir);
file_ptr = file + len;
*(file_ptr++) = '/';
}
}

while(1) {
Expand Down

0 comments on commit ca75dae

Please sign in to comment.