mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-23 01:39:55 +00:00
LibWeb: Restrict HTMLInputElement::min_length to the range of i32
This commit is contained in:
committed by
Andreas Kling
parent
40d6b9d44e
commit
bc484258c2
@@ -1849,7 +1849,7 @@ WebIDL::Long HTMLInputElement::min_length() const
|
||||
{
|
||||
// The minLength IDL attribute must reflect the minlength content attribute, limited to only non-negative numbers.
|
||||
if (auto minlength_string = get_attribute(HTML::AttributeNames::minlength); minlength_string.has_value()) {
|
||||
if (auto minlength = parse_non_negative_integer(*minlength_string); minlength.has_value())
|
||||
if (auto minlength = parse_non_negative_integer(*minlength_string); minlength.has_value() && *minlength <= 2147483647)
|
||||
return *minlength;
|
||||
}
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user