Closed Bug 1412641 Opened 7 years ago Closed 7 years ago

[Static Analysis] Uninitialized fields in some classes of accessibility

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox-esr52 --- wontfix
firefox56 --- wontfix
firefox57 --- wontfix
firefox58 --- fixed

People

(Reporter: tristanbourvon, Assigned: tristanbourvon)

References

Details

(Whiteboard: [adv-main58+])

Attachments

(1 file)

As part of the static analysis effort to ensure all class fields are initialized before usage (see https://bugzilla.mozilla.org/show_bug.cgi?id=525063), here are a few fixes to the accessibility module.
Attachment #8923160 - Flags: review?(surkov.alexander)
Blocks: 1411595
Assignee: nobody → tristanbourvon
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment on attachment 8923160 [details] [diff] [review]
accessibility.patch

Review of attachment 8923160 [details] [diff] [review]:
-----------------------------------------------------------------

::: accessible/base/TextAttrs.h
@@ +399,4 @@
>    class TextDecorValue
>    {
>    public:
> +    TextDecorValue() : mColor{0}, mLine{'\0'}, mStyle{'\0'} { }

those are ints not characters, so STYLE_TEXT_DECORATION_LINE_NONE for mLine and NS_STYLE_TEXT_DECORATION_STYLE_NONE for mStyle would be more reasonable values.

::: accessible/base/nsAccessiblePivot.cpp
@@ +21,4 @@
>  {
>  public:
>    explicit RuleCache(nsIAccessibleTraversalRule* aRule) : mRule(aRule),
> +                                                          mAcceptRoles(nullptr), mAcceptRolesLength{0}, mPreFilter{0} { }

nit: could you please change styling while you are here?
explicit RuleCache(nsIAccessibleTraversalRule* aRule) :
  mRule(aRule), mAcceptRoles(nullptr),
  mAcceptRolesLength{0}, mPreFilter{0}
{
}
Attachment #8923160 - Flags: review?(surkov.alexander) → review+
This should be backed out because it busts the build. A new patch is underway.
Since the previous push to m-i has been backed out due to build bustage, I've submitted a try build with the new changes:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d1f1129c992eda347978c767893d6c0e1423d71b
https://hg.mozilla.org/mozilla-central/rev/72522cd7b6e3
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Group: core-security → core-security-release
Whiteboard: [adv-main58+]
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: