Fix a typical off-by-one error that can result in an unterminated string:

strncpy(dst, src, sizeof(dst));

by substituting the safer strlcpy() for strncpy().

X-Security:	none (the source string isn't user-supplied)
This commit is contained in:
Yaroslav Tykhiy 2007-06-14 14:44:04 +00:00
parent 58d6bdcbe0
commit 7a855803b9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170726

View File

@ -466,7 +466,7 @@ main(int argc, char *argv[])
if ((S_IXUSR & buf.st_mode) && (run_time <=now)) {
if (isupper(queue) && (strcmp(batch_name,dirent->d_name) > 0)) {
run_batch = 1;
strncpy(batch_name, dirent->d_name, sizeof(batch_name));
strlcpy(batch_name, dirent->d_name, sizeof(batch_name));
batch_uid = buf.st_uid;
batch_gid = buf.st_gid;
}