@@ -102,30 +102,30 @@ func unmarshalAttrs(b []byte) (*FileStat, []byte) {
102
102
func getFileStat (flags uint32 , b []byte ) (* FileStat , []byte ) {
103
103
var fs FileStat
104
104
if flags & sshFileXferAttrSize == sshFileXferAttrSize {
105
- fs .Size , b = unmarshalUint64 (b )
105
+ fs .Size , b , _ = unmarshalUint64Safe (b )
106
106
}
107
107
if flags & sshFileXferAttrUIDGID == sshFileXferAttrUIDGID {
108
- fs .UID , b = unmarshalUint32 (b )
108
+ fs .UID , b , _ = unmarshalUint32Safe (b )
109
109
}
110
110
if flags & sshFileXferAttrUIDGID == sshFileXferAttrUIDGID {
111
- fs .GID , b = unmarshalUint32 (b )
111
+ fs .GID , b , _ = unmarshalUint32Safe (b )
112
112
}
113
113
if flags & sshFileXferAttrPermissions == sshFileXferAttrPermissions {
114
- fs .Mode , b = unmarshalUint32 (b )
114
+ fs .Mode , b , _ = unmarshalUint32Safe (b )
115
115
}
116
116
if flags & sshFileXferAttrACmodTime == sshFileXferAttrACmodTime {
117
- fs .Atime , b = unmarshalUint32 (b )
118
- fs .Mtime , b = unmarshalUint32 (b )
117
+ fs .Atime , b , _ = unmarshalUint32Safe (b )
118
+ fs .Mtime , b , _ = unmarshalUint32Safe (b )
119
119
}
120
120
if flags & sshFileXferAttrExtented == sshFileXferAttrExtented {
121
121
var count uint32
122
- count , b = unmarshalUint32 (b )
122
+ count , b , _ = unmarshalUint32Safe (b )
123
123
ext := make ([]StatExtended , count )
124
124
for i := uint32 (0 ); i < count ; i ++ {
125
125
var typ string
126
126
var data string
127
- typ , b = unmarshalString (b )
128
- data , b = unmarshalString (b )
127
+ typ , b , _ = unmarshalStringSafe (b )
128
+ data , b , _ = unmarsha
8000
lStringSafe (b )
129
129
ext [i ] = StatExtended {typ , data }
130
130
}
131
131
fs .Extended = ext
0 commit comments