File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
stdlib/public/RuntimeModule Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1475,6 +1475,11 @@ final class ElfImage<SomeElfTraits: ElfTraits>
1475
1475
let stringSect = ElfStringSection ( source: stringSource)
1476
1476
1477
1477
for shdr in sectionHeaders {
1478
+ // All other fields are undefined for SHT_NULL
1479
+ if shdr. sh_type == . SHT_NULL {
1480
+ continue
1481
+ }
1482
+
1478
1483
guard let name = stringSect. getStringAt ( index: Int ( shdr. sh_name) ) else {
1479
1484
continue
1480
1485
}
@@ -1612,6 +1617,11 @@ final class ElfImage<SomeElfTraits: ElfTraits>
1612
1617
let stringSect = ElfStringSection ( source: stringSource)
1613
1618
1614
1619
for shdr in sectionHeaders {
1620
+ // All other fields are undefined for SHT_NULL
1621
+ if shdr. sh_type == . SHT_NULL {
1622
+ continue
1623
+ }
1624
+
1615
1625
guard let sname
1616
1626
= stringSect. getStringAt ( index: Int ( shdr. sh_name) ) else {
1617
1627
continue
You can’t perform that action at this time.
0 commit comments