mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 00:38:48 +00:00
LibWeb: Restrict HTMLTextAreaElement::max_length
to the range of i32
This commit is contained in:
parent
bc484258c2
commit
ac7fad52f6
Notes:
github-actions[bot]
2024-12-02 09:26:54 +00:00
Author: https://github.com/tcl3
Commit: ac7fad52f6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2685
3 changed files with 20 additions and 1 deletions
|
@ -259,7 +259,7 @@ WebIDL::Long HTMLTextAreaElement::max_length() const
|
|||
{
|
||||
// The maxLength IDL attribute must reflect the maxlength content attribute, limited to only non-negative numbers.
|
||||
if (auto maxlength_string = get_attribute(HTML::AttributeNames::maxlength); maxlength_string.has_value()) {
|
||||
if (auto maxlength = parse_non_negative_integer(*maxlength_string); maxlength.has_value())
|
||||
if (auto maxlength = parse_non_negative_integer(*maxlength_string); maxlength.has_value() && *maxlength <= 2147483647)
|
||||
return *maxlength;
|
||||
}
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue