1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 18:17:52 -05:00

deal with empty input in ReadAllToBytes.

This commit is contained in:
Darien Raymond 2018-05-28 15:38:29 +02:00
parent d6513ee4ec
commit e3508fffc6
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -47,6 +47,9 @@ func ReadAllToBytes(reader io.Reader) ([]byte, error) {
if err != nil {
return nil, err
}
if mb.Len() == 0 {
return nil, nil
}
b := make([]byte, mb.Len())
common.Must2(mb.Read(b))
mb.Release()