mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-27 13:34:00 +01:00
Use strlcpy() instead of strcpy() to not overflow static buffers.
This commit is contained in:
parent
5dfca833cf
commit
b241e69d12
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104586
@ -107,7 +107,9 @@ main(int ac, char **av)
|
||||
cflag = 1;
|
||||
break;
|
||||
case 'e':
|
||||
strcpy(execfile, optarg);
|
||||
if (strlcpy(execfile, optarg, sizeof(execfile))
|
||||
>= sizeof(execfile))
|
||||
errx(1, "%s: File name too long", optarg);
|
||||
eflag = 1;
|
||||
break;
|
||||
case 'f':
|
||||
@ -119,7 +121,9 @@ main(int ac, char **av)
|
||||
err(1, "%s", optarg);
|
||||
break;
|
||||
case 'm':
|
||||
strcpy(corefile, optarg);
|
||||
if (strlcpy(corefile, optarg, sizeof(corefile))
|
||||
>= sizeof(corefile))
|
||||
errx(1, "%s: File name too long", optarg);
|
||||
mflag = 1;
|
||||
break;
|
||||
case 'o':
|
||||
|
Loading…
Reference in New Issue
Block a user