mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Allocate auxv with better capacity while loading stack
This commit is contained in:
@@ -190,7 +190,7 @@ func (s *Stack) Load(args []string, env []string, aux Auxv) (StackLayout, error)
|
||||
// NOTE: We need an extra zero here per spec.
|
||||
// The Push function will automatically terminate
|
||||
// strings and arrays with a single null value.
|
||||
auxv := make([]hostarch.Addr, 0, len(aux))
|
||||
auxv := make([]hostarch.Addr, 0, len(aux)*2+1)
|
||||
for _, a := range aux {
|
||||
auxv = append(auxv, hostarch.Addr(a.Key), a.Value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user