Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix crash when installing netbeans
Bryan Drewery committed 12 years ago
commit af878cea6be4464d74dd55f41ab9613b84af4144
parent e4b31aa
1 file changed +8 -2
modified libpkg/pkg_elf.c
@@ -305,7 +305,10 @@ analyse_elf(struct pkg *pkg, const char *fpath,
	}

	if (note != NULL) {
-
		data = elf_getdata(note, NULL);
+
		if ((data = elf_getdata(note, NULL)) == NULL) {
+
			ret = EPKG_END; /* Some error occurred, ignore this file */
+
			goto cleanup;
+
		}
		osname = (const char *) data->d_buf + sizeof(Elf_Note);
		if (strncasecmp(osname, "freebsd", sizeof("freebsd")) != 0 &&
		    strncasecmp(osname, "dragonfly", sizeof("dragonfly")) != 0) {
@@ -319,7 +322,10 @@ analyse_elf(struct pkg *pkg, const char *fpath,
		}
	}

-
	data = elf_getdata(dynamic, NULL);
+
	if ((data = elf_getdata(dynamic, NULL)) == NULL) {
+
		ret = EPKG_END; /* Some error occurred, ignore this file */
+
		goto cleanup;
+
	}

	/* First, scan through the data from the .dynamic section to
	   find any RPATH or RUNPATH settings.  These are colon