summaryrefslogtreecommitdiffstats
path: root/usr.bin/ar
diff options
context:
space:
mode:
authorarr <arr@FreeBSD.org>2001-11-20 16:47:42 +0000
committerarr <arr@FreeBSD.org>2001-11-20 16:47:42 +0000
commitd2f823593c6c3eae8866726d9c61f5899720287f (patch)
tree40b2696a1b6ba26c08b711b08737af275e1a024e /usr.bin/ar
parentc0eac83160e108c5bb1862cabc25a909c66f9581 (diff)
downloadFreeBSD-src-d2f823593c6c3eae8866726d9c61f5899720287f.zip
FreeBSD-src-d2f823593c6c3eae8866726d9c61f5899720287f.tar.gz
- When copying into a fixed buffer, bounds checking should occur.
PR: bin/31673
Diffstat (limited to 'usr.bin/ar')
-rw-r--r--usr.bin/ar/misc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ar/misc.c b/usr.bin/ar/misc.c
index d99d956..0a0dd1b 100644
--- a/usr.bin/ar/misc.c
+++ b/usr.bin/ar/misc.c
@@ -73,9 +73,10 @@ tmp()
}
if (envtmp)
- (void)sprintf(path, "%s/%s", envtmp, _NAME_ARTMP);
+ (void)snprintf(path, sizeof(path), "%s/%s", envtmp,
+ _NAME_ARTMP);
else
- strcpy(path, _PATH_ARTMP);
+ strlcpy(path, _PATH_ARTMP, sizeof(path));
sigfillset(&set);
(void)sigprocmask(SIG_BLOCK, &set, &oset);
OpenPOWER on IntegriCloud