Check data length

This commit is contained in:
obscuren
2014-08-23 15:30:23 +02:00
parent ded013b7a7
commit 444c9effdb
3 changed files with 1 additions and 3 deletions

View File

@ -53,7 +53,7 @@ func (self *UiLib) LookupDomain(domain string) string {
data := world.Config().Get("DnsReg").StorageString(domain).Bytes()
// Left padded = A record, Right padded = CNAME
if data[0] == 0 {
if len(data) > 0 && data[0] == 0 {
data = bytes.TrimLeft(data, "\x00")
var ipSlice []string
for _, d := range data {