File tree 1 file changed +0
-52
lines changed
1 file changed +0
-52
lines changed Original file line number Diff line number Diff line change 9
9
"compress/gzip"
10
10
"debug/dwarf"
11
11
"encoding/binary"
12
- "fmt"
13
12
"io"
14
13
"math/rand"
15
14
"net"
@@ -18,7 +17,6 @@ import (
18
17
"reflect"
19
18
"runtime"
20
19
"testing"
21
- "time"
22
20
)
23
21
24
22
type fileTest struct {
@@ -956,53 +954,3 @@ func TestIssue10996(t *testing.T) {
956
954
t .Fatalf ("opening invalid ELF file unexpectedly succeeded" )
957
955
}
958
956
}
959
-
960
- // TestInvalidBssSection is a regression test for golang.org/issue/54967.
961
- //
962
- // (*Section).Data should not use safeio to read data from the SHT_NOBITS
963
- // section. Otherwise, when the section size is an incorrect huge value,
964
- // it will result in OOM.
965
- func TestInvalidBssSection (t * testing.T ) {
966
- c := make (chan error )
967
- go func () {
968
- defer func () {
969
- switch err := recover ().(type ) {
970
- case nil :
971
- c <- nil
972
- case error :
973
- c <- err
974
- default :
975
- c <- fmt .Errorf ("unexpected panic value: %T(%v)" , err , err )
976
- }
977
- }()
978
-
979
- size := uint64 (3349099659509720927 )
980
- s := new (Section )
981
- s .SectionHeader = SectionHeader {
982
- Name : ".bss" ,
983
- Type : SHT_NOBITS ,
984
- Flags : SHF_WRITE + SHF_ALLOC ,
985
- Addr : 0x80496d4 ,
986
- Offset : 0x6d4 ,
987
- Size : size ,
988
- Link : 0x0 ,
989
- Info : 0x0 ,
990
- Addralign : 0x4 ,
991
- Entsize : 0x0 ,
992
- FileSize : size ,
993
- }
994
- _ , _ = s .Data ()
995
- }()
996
-
997
- select {
998
- case err := <- c :
999
- wantErr := "runtime error: makeslice: len out of range"
1000
- if err == nil {
1001
- t .Errorf ("got error nil; want error %q" , wantErr )
1002
- } else if errMsg := err .Error (); errMsg != wantErr {
1003
- t .Errorf ("got error %q; want error %q" , errMsg , wantErr )
1004
- }
1005
- case <- time .After (time .Second ):
1006
- t .Fatal ("test timed out (saferio.ReadData is called?)" )
1007
- }
1008
- }
You can’t perform that action at this time.
0 commit comments