Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
ubsan: fix undefined behaviour
Baptiste Daroussin committed 4 years ago
commit 48f327298ebc2bd140b74989ebb6374fe34b330f
parent cc2f7f96b01a3b11bc83fedc98c1bcdd4d56cbbe
1 file changed +1 -1
modified libpkg/utils.c
@@ -795,7 +795,7 @@ pkg_absolutepath(const char *src, char *dest, size_t dest_size, bool fromroot) {
	}
	dest_len = strlen(dest);

-
	for (cur = next = src; next != NULL; cur = next + 1) {
+
	for (cur = next = src; next != NULL; cur = (next == NULL) ? NULL : next + 1) {
		next = strchr(cur, '/');
		if (next != NULL)
			cur_len = next - cur;