diff options
author | sobomax <sobomax@FreeBSD.org> | 2001-10-15 18:21:08 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2001-10-15 18:21:08 +0000 |
commit | 8d45c0568791bbcc1147afa6e857e7b307c43c11 (patch) | |
tree | a6d2e1843a43692b33380ecdb4041076a923ce42 /usr.sbin | |
parent | 5d13f1960fb8c61745c3210781bf589d1b4472e1 (diff) | |
download | FreeBSD-src-8d45c0568791bbcc1147afa6e857e7b307c43c11.zip FreeBSD-src-8d45c0568791bbcc1147afa6e857e7b307c43c11.tar.gz |
Use strncpy(3) instead of strcpy(3) to copy optarg into a fixed-sized buffer.
Prompted by: dd
MFC after: 2 weeks
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_install/create/main.c | 2 | ||||
-rw-r--r-- | usr.sbin/pkg_install/info/main.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/create/main.c b/usr.sbin/pkg_install/create/main.c index 569d4f5..3c4de03 100644 --- a/usr.sbin/pkg_install/create/main.c +++ b/usr.sbin/pkg_install/create/main.c @@ -109,7 +109,7 @@ main(int argc, char **argv) break; case 't': - strcpy(PlayPen, optarg); + strncpy(PlayPen, optarg, sizeof(PlayPen)); break; case 'X': diff --git a/usr.sbin/pkg_install/info/main.c b/usr.sbin/pkg_install/info/main.c index 3c78c2f..d77ff0b 100644 --- a/usr.sbin/pkg_install/info/main.c +++ b/usr.sbin/pkg_install/info/main.c @@ -147,7 +147,7 @@ main(int argc, char **argv) break; case 't': - strcpy(PlayPen, optarg); + strncpy(PlayPen, optarg, sizeof(PlayPen)); break; case 'x': |