nsAccessible::GetChildCount should return unsigned int

RESOLVED FIXED in mozilla15

Status

()

Core
Disability Access APIs
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: surkov, Assigned: surkov)

Tracking

(Blocks: 1 bug)

unspecified
mozilla15
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 624733 [details] [diff] [review]
patch
Attachment #624733 - Flags: review?(trev.saunders)
(Assignee)

Comment 1

5 years ago
bumping it in Trevor's queue (sorry for the spam)
Comment on attachment 624733 [details] [diff] [review]
patch

>-  PRInt32 siblingCount = parent->GetChildCount();
>-  if (siblingCount < indexInParent) {
>+  PRUint32 siblingCount = parent->ChildCount();
>+  if (indexInParent == -1 ||
>+      indexInParent >= static_cast<PRInt32>(siblingCount)) {

wouldn't indexInParent < 0 be safer?
Attachment #624733 - Flags: review?(trev.saunders) → review+
(Assignee)

Comment 3

5 years ago
(In reply to Trevor Saunders (:tbsaunde) from comment #2)

> wouldn't indexInParent < 0 be safer?

yes like null checking the every pointer but that means there's something pretty wrong, I wouldn't hide errors.
(Assignee)

Comment 4

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/8da4ff25a24a
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/8da4ff25a24a
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.