Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
avoid segfault when parsing port options
Philippe Pepiot committed 15 years ago
commit 3afc895f5b49154ce058975522dbf6128b0994aa
parent 69cc1103c4887a7c87b93080351551ed12c88982
1 file changed +6 -4
modified libpkg/pkg_ports.c
@@ -223,10 +223,12 @@ ports_parse_options(struct pkg *pkg, char *options)

	next = strlen(option_p);
	for (i = 0; i <= nbel; i++) {
-
		value = strrchr(option_p, '=');
-
		value[0] = '\0';
-
		value++;
-
		pkg_addoption(pkg, option_p, value);
+

+
		if ((value = strrchr(option_p, '=')) != NULL) {
+
			value[0] = '\0';
+
			value++;
+
			pkg_addoption(pkg, option_p, value);
+
		}

		option_p += next + 1;
		next = strlen(option_p);