Validate complete import depth numbers
This commit is contained in:
@@ -427,7 +427,8 @@ func parseImportDepth(node *document.Node) (int, bool) {
|
||||
}
|
||||
digit := uint64(character - '0')
|
||||
if value > (maxInt-digit)/10 {
|
||||
return int(maxInt), true
|
||||
value = maxInt
|
||||
continue // Saturate the bound, but validate every remaining character.
|
||||
}
|
||||
value = value*10 + digit
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user