Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
ubsan: fix undefined behaviour
Baptiste Daroussin committed 4 years ago
commit 48f327298ebc2bd140b74989ebb6374fe34b330f
parent cc2f7f9
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;