mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-03 07:45:29 -05:00
deal with empty input in ReadAllToBytes.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user