mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 08:18:49 +00:00
LibWeb: Restrict HTMLInputElement::min_length
to the range of i32
This commit is contained in:
parent
40d6b9d44e
commit
bc484258c2
Notes:
github-actions[bot]
2024-12-02 09:27:00 +00:00
Author: https://github.com/tcl3
Commit: bc484258c2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2685
3 changed files with 20 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue