Fix read DNS message

This commit is contained in:
世界
2022-08-26 13:13:44 +08:00
parent 9ac31d0233
commit c5e38203eb
2 changed files with 53 additions and 46 deletions

View File

@@ -22,7 +22,7 @@ func StreamDomainNameQuery(readCtx context.Context, reader io.Reader) (*adapter.
if err != nil {
return nil, err
}
if length > 512 {
if length == 0 {
return nil, os.ErrInvalid
}
_buffer := buf.StackNewSize(int(length))