fix: panic scanning binaries without symtab (#2739)

Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
Keith Zantow
2024-03-27 13:51:45 -04:00
committed by GitHub
parent 469b4c13bb
commit 410867ca0c
3 changed files with 12 additions and 1 deletions
+3
View File
@@ -57,6 +57,9 @@ func machoHasEntrypoint(f *macho.File) bool {
}
func machoHasExports(f *macho.File) bool {
if f == nil || f.Symtab == nil {
return false
}
for _, sym := range f.Symtab.Syms {
// look for symbols that are:
// - not private and are external