diff options
author | Martin Winter <mwinter@opensourcerouting.org> | 2017-02-03 12:09:36 +0100 |
---|---|---|
committer | Martin Winter <mwinter@opensourcerouting.org> | 2017-02-10 10:50:23 +0100 |
commit | 67e5d67651bd94b52e33442308158a415e43f39f (patch) | |
tree | 70f7e5cf24d2781e9cbea975574fbfe7dc317267 /ospfd | |
parent | Merge pull request #191 from opensourcerouting/ospfclient-incl (diff) | |
download | frr-67e5d67651bd94b52e33442308158a415e43f39f.tar.xz frr-67e5d67651bd94b52e33442308158a415e43f39f.zip |
ospfd: Fix Coverity Warning CID 1399480 (#1 of 1): Buffer not null terminated (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>
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 845d96032..cc335a8ab 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -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); |