1
mirror of https://github.com/XTLS/Xray-core.git synced 2025-12-12 04:34:41 +04:00

DNS: Fix wrong protocol parse (#5232)

Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
This commit is contained in:
vanserox
2025-11-21 10:31:34 +08:00
committed by GitHub
parent e914183996
commit 27ad487545
2 changed files with 2 additions and 2 deletions

View File

@@ -146,7 +146,7 @@ func (s *QUICNameServer) sendQuery(ctx context.Context, noResponseErrCh chan<- e
noResponseErrCh <- err
return
}
var length int16
var length uint16
err = binary.Read(bytes.NewReader(respBuf.Bytes()), binary.BigEndian, &length)
if err != nil {
errors.LogErrorInner(ctx, err, "failed to parse response length")

View File

@@ -173,7 +173,7 @@ func (s *TCPNameServer) sendQuery(ctx context.Context, noResponseErrCh chan<- er
noResponseErrCh <- err
return
}
var length int16
var length uint16
err = binary.Read(bytes.NewReader(respBuf.Bytes()), binary.BigEndian, &length)
if err != nil {
errors.LogErrorInner(ctx, err, "failed to parse response length")