fixes #68405
Change-Id: I043e16f43daa336005695f82a53f9a52cd770656
GitHub-Last-Rev:
69f1ae8b648083154c64f0679b7bd97a118607e9
GitHub-Pull-Request: golang/go#68409
Reviewed-on: https://go-review.googlesource.com/c/go/+/597956
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Zxilly Chou <zxilly@outlook.com>
Reviewed-by: Than McIntosh <thanm@google.com>
"encoding/binary"
"fmt"
"internal/buildcfg"
+ "math"
"sort"
"strconv"
"strings"
pe64 int
dr *Dll
- dexport = make([]loader.Sym, 0, 1024)
+ dexport []loader.Sym
)
// peStringTable is a COFF string table.
if !ldr.AttrReachable(s) || !ldr.AttrCgoExportDynamic(s) {
continue
}
- if len(dexport)+1 > cap(dexport) {
+ if len(dexport) >= math.MaxUint16 {
ctxt.Errorf(s, "pe dynexport table is full")
errorexit()
}