shstrndx = int(hdr.Shstrndx)
}
+ if shoff < 0 {
+ return nil, &FormatError{0, "invalid shoff", shoff}
+ }
+ if phoff < 0 {
+ return nil, &FormatError{0, "invalid phoff", phoff}
+ }
+
if shoff == 0 && shnum != 0 {
return nil, &FormatError{0, "invalid ELF shnum for shoff=0", shnum}
}
Entsize: sh.Entsize,
}
}
+ if int64(s.Offset) < 0 {
+ return nil, &FormatError{off, "invalid section offset", int64(s.Offset)}
+ }
+ if int64(s.FileSize) < 0 {
+ return nil, &FormatError{off, "invalid section size", int64(s.FileSize)}
+ }
s.sr = io.NewSectionReader(r, int64(s.Offset), int64(s.FileSize))
if s.Flags&SHF_COMPRESSED == 0 {