Skip to content

Commit

Permalink
ospfd: Fix Coverity Warning CID 1399480 (#1 of 1): Buffer not null te…
Browse files Browse the repository at this point in the history
…rminated (BUFFER_SIZE_WARNING)

Coverity: buffer_size_warning: Calling strncpy with a maximum size argument of 100 bytes on destination array pid_file of size 100 bytes might leave the destination string unterminated.
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
  • Loading branch information
mwinter-osr committed Feb 10, 2017
1 parent 3cf5e24 commit 67e5d67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ospfd/ospf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ main (int argc, char **argv)
pid_file[0] = '\0';

snprintf(pidfile_temp, sizeof(pidfile_temp), "%s/ospfd-%d.pid", pid_file, instance );
strncpy(pid_file, pidfile_temp, sizeof(pid_file));
strlcpy(pid_file, pidfile_temp, sizeof(pid_file));
}
/* Process id file create. */
pid_output (pid_file);
Expand Down

0 comments on commit 67e5d67

Please sign in to comment.