Closed
Bug 710973
Opened 13 years ago
Closed 13 years ago
Possible bad input validation in PresShell::SetResolution()
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: Dolske, Assigned: daniellevin2607)
References
Details
(Whiteboard: [pvs-studio][good first bug][lang=c++])
Attachments
(1 file)
(deleted),
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
From http://www.viva64.com/en/a/0078/
Example 6. Incomplete checking of input values
nsresult PresShell::SetResolution(float aXResolution, float aYResolution)
{
if (!(aXResolution > 0.0 && aXResolution > 0.0)) {
return NS_ERROR_ILLEGAL_VALUE;
}
...
}
PVS-Studio diagnostic message: V501 There are identical sub-expressions to the left and to the right of the '&&' operator: aXResolution > 0.0 && aXResolution > 0.0 nspresshell.cpp 5114
And here was one more example of invalid input parameters verification. This time, a misprint doesn't allow the program to check the aYResolution argument's value.
Updated•13 years ago
|
Whiteboard: [pvs-studio] → [pvs-studio][good first bug][lang=c++]
Updated•13 years ago
|
Component: General → Layout
QA Contact: general → layout
Assignee | ||
Comment 1•13 years ago
|
||
The double-checking flagged was checking the X value twice and not checking the Y value. The Y value is now checked
Attachment #596338 -
Flags: superreview?
Attachment #596338 -
Flags: review?
Assignee | ||
Updated•13 years ago
|
Attachment #596338 -
Flags: review?(jones.chris.g)
Comment 2•13 years ago
|
||
Comment on attachment 596338 [details] [diff] [review]
A patch to correct this bug
Stealing review for this obvious fix.
Attachment #596338 -
Flags: superreview?
Attachment #596338 -
Flags: review?(jones.chris.g)
Attachment #596338 -
Flags: review?
Attachment #596338 -
Flags: review+
Updated•13 years ago
|
Keywords: checkin-needed
Updated•13 years ago
|
Assignee: nobody → daniellevin2607
Updated•13 years ago
|
Status: NEW → ASSIGNED
Comment 3•13 years ago
|
||
Keywords: checkin-needed
Target Milestone: --- → mozilla13
Comment 4•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/2348e10c9782
Thanks for the patch! Join us on irc (#developers on irc.mozilla.org) and we'll find some other things for you to work on if you are interested? :-D
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•