File tree 2 files changed +10
-12
lines changed
2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -25,17 +25,16 @@ func (pk *ConnectionRequestAccepted) UnmarshalBinary(data []byte) error {
25
25
pk .SystemIndex = binary .BigEndian .Uint16 (data [offset :])
26
26
offset += 2
27
27
for i := range 20 {
28
- if len (data ) < addrSize (data [offset :]) {
28
+ if len (data [offset :]) == 16 {
29
+ // Some implementations send fewer system addresses.
30
+ break
31
+ }
32
+ if len (data [offset :]) < addrSize (data [offset :]) {
29
33
return io .ErrUnexpectedEOF
30
34
}
31
35
address , n := addr (data [offset :])
32
36
pk .SystemAddresses [i ] = address
33
37
offset += n
34
-
35
- if len (data [offset :]) == 16 {
36
- // Some implementations send only 10 system addresses.
37
- break
38
- }
39
38
}
40
39
if len (data [offset :]) < 16 {
41
40
return io .ErrUnexpectedEOF
Original file line number Diff line number Diff line change @@ -22,17 +22,16 @@ func (pk *NewIncomingConnection) UnmarshalBinary(data []byte) error {
22
22
var offset int
23
23
pk .ServerAddress , offset = addr (data )
24
24
for i := range 20 {
25
- if len (data ) < addrSize (data [offset :]) {
25
+ if len (data [offset :]) == 16 {
26
+ // Some implementations send only 10 system addresses.
27
+ break
28
+ }
29
+ if len (data [offset :]) < addrSize (data [offset :]) {
26
30
return io .ErrUnexpectedEOF
27
31
}
28
32
address , n := addr (data [offset :])
29
33
pk .SystemAddresses [i ] = address
30
34
offset += n
31
-
32
- if len (data [offset :]) == 16 {
33
- // Some implementations send only 10 system addresses.
34
- break
35
- }
36
35
}
37
36
if len (data [offset :]) < 16 {
38
37
return io .ErrUnexpectedEOF
You can’t perform that action at this time.
0 commit comments