1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Fix octodns: constant 4294967295 overflows int (Issue #736) (#738)

This commit is contained in:
Bernhard Fröhlich
2020-05-08 00:42:54 +02:00
committed by GitHub
parent 3989be8a3b
commit ec27d2c76a

View File

@ -12,7 +12,6 @@ import (
"fmt"
"io"
"io/ioutil"
"math"
"reflect"
"strconv"
@ -263,8 +262,8 @@ func decodeTTL(ttl interface{}) (uint32, error) {
return uint32(t), fmt.Errorf("decodeTTL failed to parse (%s): %w", s, err)
case int:
i := ttl.(int)
if i < 0 || i > math.MaxUint32 {
return 0, fmt.Errorf("ttl won't fit in 32-bits (%d)", i)
if i < 0 {
return 0, fmt.Errorf("ttl cannot be negative (%d)", i)
}
return uint32(i), nil
}