mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 08:52:07 +01:00
Correct a reversion in r1.39 which introduced a new instance of strcpy()
after r1.38 had attempted to remove them all.
This commit is contained in:
parent
3ad234d4ef
commit
1da665ef09
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79916
@ -172,10 +172,12 @@ main(int argc, char **argv)
|
||||
if (fexists(*argv)) /* refers to a file directly */
|
||||
pkgs[ch] = realpath(*argv, pkgnames[ch]);
|
||||
else { /* look for the file in the expected places */
|
||||
if (!(cp = fileFindByPath(NULL, *argv)))
|
||||
/* let pkg_do() fail later, so that error is reported */
|
||||
pkgs[ch] = strcpy(pkgnames[ch], *argv);
|
||||
else {
|
||||
if (!(cp = fileFindByPath(NULL, *argv))) {
|
||||
/* let pkg_do() fail later, so that error is reported */
|
||||
if (s_strlcpy(pkgnames[ch], *argv, sizeof(pkgnames[ch])))
|
||||
errx(1, "package name too long");
|
||||
pkgs[ch] = pkgnames[ch];
|
||||
} else {
|
||||
if (s_strlcpy(pkgnames[ch], cp, sizeof(pkgnames[ch])))
|
||||
errx(1, "package name too long");
|
||||
pkgs[ch] = pkgnames[ch];
|
||||
|
Loading…
Reference in New Issue
Block a user