Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Early quit if testing elf analysis if not in a analysable format
Baptiste Daroussin committed 11 years ago
commit 7d03438a4eaa6cffdac975721d8137dc1fca17bb
parent 04e897b
1 file changed +7 -0
modified libpkg/pkg_elf.c
@@ -270,6 +270,12 @@ analyse_elf(struct pkg *pkg, const char *fpath)
		goto cleanup;
	}

+
	if (elfhdr.e_type != ET_DYN && elfhdr.e_type != ET_EXEC &&
+
	    elfhdr.e_type != ET_REL) {
+
		ret = EPKG_END;
+
		goto cleanup;
+
	}
+

	/* Elf file has sections header */
	while ((scn = elf_nextscn(e, scn)) != NULL) {
		if (gelf_getshdr(scn, &shdr) != &shdr) {
@@ -702,6 +708,7 @@ pkg_get_myarch_elfparse(char *dest, size_t sz)
		goto cleanup;
	}

+

	while ((scn = elf_nextscn(elf, scn)) != NULL) {
		if (gelf_getshdr(scn, &shdr) != &shdr) {
			ret = EPKG_FATAL;