Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Check strlcpy(3) return value in pkg which.
Alexandre Perrin committed 12 years ago
commit aca9dde8956681f1dd85fa1a5a52735cde76986c
parent 3afe4d3
1 file changed +4 -2
modified pkg/which.c
@@ -87,8 +87,10 @@ exec_which(int argc, char **argv)

	if (!glob)
		absolutepath(argv[0], pathabs, sizeof(pathabs));
-
	else
-
		strlcpy(pathabs, argv[0], sizeof(pathabs));
+
	else {
+
		if (strlcpy(pathabs, argv[0], sizeof(pathabs)) >= sizeof(pathabs))
+
			return (EX_USAGE);
+
	}

	if ((it = pkgdb_query_which(db, pathabs, glob)) == NULL)
		return (EX_IOERR);