CID
1296375 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)
buffer_size_warning: Calling strncpy with a maximum size argument of
1024 bytes on destination array logfile of size 1024 bytes might leave
the destination string unterminated.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
prt("file name to long\n");
exit(1);
}
- strncpy(logfile, dirpath, sizeof(logfile));
+ strncpy(logfile, dirpath, sizeof(logfile)-1);
+ logfile[sizeof(logfile)-1] = '\0';
if (strlen(logfile) < sizeof(logfile)-2) {
strcat(logfile, "/");
} else {