Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Avoid an out-of-bounds array access
Alex Richardson committed 5 years ago
commit 0032563c532898aea41119429777e6974fd770de
parent c8dc02c
1 file changed +1 -1
modified libpkg/pkg_ports.c
@@ -1317,7 +1317,7 @@ plist_new(struct pkg *pkg, const char *stage)
	p->pkg = pkg;
	if (pkg->prefix != NULL)
		strlcpy(p->prefix, pkg->prefix, sizeof(p->prefix));
-
	p->slash = p->prefix[strlen(p->prefix) - 1] == '/' ? "" : "/";
+
	p->slash = *p->prefix != '\0' && p->prefix[strlen(p->prefix) - 1] == '/' ? "" : "/";
	p->stage = stage;

	p->uname = xstrdup("root");