Limit geohash precision to 12

This commit is contained in:
tidwall 2020-08-12 10:58:49 -07:00
parent 25a954a6aa
commit 9093926135
1 changed files with 2 additions and 1 deletions

View File

@ -662,7 +662,8 @@ func (s *Server) parseSearchScanBaseTokens(
}
}
if sprecision != "" {
if t.precision, err = strconv.ParseUint(sprecision, 10, 64); err != nil || t.precision == 0 || t.precision > 64 {
t.precision, err = strconv.ParseUint(sprecision, 10, 64)
if err != nil || t.precision == 0 || t.precision > 12 {
err = errInvalidArgument(sprecision)
return
}