read/pe: check for empty import names (#873)

This commit is contained in:
Philip Craig
2026-04-04 10:51:47 +10:00
committed by GitHub
parent c7233dcf68
commit 6886fb3efc
+4
View File
@@ -92,6 +92,8 @@ impl<'data> ImportTable<'data> {
.get(LE);
let name = data
.read_string()
.ok()
.filter(|s| !s.is_empty())
.read_error("Missing PE import thunk name")?;
Ok((hint, name))
}
@@ -331,6 +333,8 @@ impl<'data> DelayLoadImportTable<'data> {
.get(LE);
let name = data
.read_string()
.ok()
.filter(|s| !s.is_empty())
.read_error("Missing PE delay load import thunk name")?;
Ok((hint, name))
}