dns: check length in UnmarshalDomain to avoid panic

This commit is contained in:
nadoo committed 2020-08-21 23:54:18 +08:00
1 parent a118ec5837
commit a42d3a68d0
6 files changed
+18 -11

No files matched your search

+2 -1
View File
@@ -88,9 +88,10 @@ func (s *UoTTun) ListenAndServe() {
}
// remote forwarder, udp over tcp
// TODO: check here carefully, ReadAll allocates buffer and may leads to memory leak.
resp, err := ioutil.ReadAll(rc)
if err != nil {
log.F("error in ioutil.ReadAll: %s\n", err)
log.F("[uottun] error in ioutil.ReadAll: %s\n", err)
return
}
rc.Close()