nsAccessible::GetChildCount should return unsigned int

RESOLVED FIXED in mozilla15

Status

()

RESOLVED FIXED
7 years ago
7 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

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

Comment 1

7 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

7 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.
https://hg.mozilla.org/mozilla-central/rev/8da4ff25a24a
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.