mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-26 16:18:31 +00:00
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:
parent
58d6bdcbe0
commit
7a855803b9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170726
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user