Page MenuHomeWildfire Games

Fix text input max_length attribute.
Needs ReviewPublic

Authored by Stan on Oct 15 2019, 3:10 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

See #5266 caused by rP15785

Test Plan

Check any text fuzzing you now to make sure one cannot enter more than X characters in the fields with a max_length attribute.

Diff Detail

Event Timeline

Stan created this revision.Oct 15 2019, 3:10 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/974/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/459/display/redirect

Stan added a comment.EditedOct 15 2019, 3:17 PM

Original patch was made by Amplikon, but has been mostly rewritten.

To answer smiley's comments,

In #5266, @smiley wrote:

Use static_cast<int> instead of (int).

Done.

In #5266, @smiley wrote:

Unsigned integer probably.

int is used everywhere else except in one place where it uses long for some reason.

In #5266, @smiley wrote:

Sure it should not be a break;? (Same thing is in L308, Plus, from a quick skim, break; makes more sense to me. Could be wrong of course.)

Yep, because in this case if the function expect a return type, which was not easily visible without context.

Stan added a subscriber: smiley.Oct 15 2019, 3:18 PM
Stan removed a subscriber: smiley.
smiley added a comment.EditedOct 15 2019, 4:54 PM

Since apparently I had commented on this before, I have a feeling this would not quite work the way it should in certain cases.

Then again, its just a feeling. Consider that before wasting hours on potentially nothing.

Stan added a subscriber: smiley.Oct 15 2019, 4:58 PM
In D2377#99209, @smiley wrote:

Since apparently I had commented on this before, I have a feeling this would not quite work the way it should in certain cases.
Then again, its just a feeling. Consider that before wasting hours on potentially nothing.

Thanks for the fair warning, and the time you took to express it :)