diff options
author | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2007-06-14 14:44:04 +0000 |
---|---|---|
committer | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2007-06-14 14:44:04 +0000 |
commit | 7a855803b9e47b44443361253da7ecbb9a16eaf5 (patch) | |
tree | 1ab4b40bf9fdf4f4f171359976d2253b60d532e5 /libexec/atrun/atrun.c | |
parent | 58d6bdcbe0af72d6cdf9c21f917bec3daae906a4 (diff) | |
download | src-7a855803b9e47b44443361253da7ecbb9a16eaf5.tar.gz src-7a855803b9e47b44443361253da7ecbb9a16eaf5.zip |
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)
Notes
Notes:
svn path=/head/; revision=170726
Diffstat (limited to 'libexec/atrun/atrun.c')
-rw-r--r-- | libexec/atrun/atrun.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libexec/atrun/atrun.c b/libexec/atrun/atrun.c index 8a9891c692be..5261c9709bbf 100644 --- a/libexec/atrun/atrun.c +++ b/libexec/atrun/atrun.c @@ -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; } |