mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 10:08:15 -05:00
deal with empty input in ReadAllToBytes.
This commit is contained in:
parent
d6513ee4ec
commit
e3508fffc6
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user