Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Avoid an out-of-bounds array access
Alex Richardson committed 5 years ago
commit 0032563c532898aea41119429777e6974fd770de
parent c8dc02cdc848bd895e9dacfffb96df4984a5cfb7
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");