Last Comment Bug 756087 - nsAccessible::GetChildCount should return unsigned int
: nsAccessible::GetChildCount should return unsigned int
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla15
Assigned To: alexander :surkov
:
Mentors:
Depends on:
Blocks: cleana11y
  Show dependency treegraph
 
Reported: 2012-05-17 07:28 PDT by alexander :surkov
Modified: 2012-05-26 05:09 PDT (History)
2 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (38.43 KB, patch)
2012-05-17 07:28 PDT, alexander :surkov
tbsaunde+mozbugs: review+
Details | Diff | Splinter Review

Description alexander :surkov 2012-05-17 07:28:58 PDT
Created attachment 624733 [details] [diff] [review]
patch
Comment 1 alexander :surkov 2012-05-22 02:48:53 PDT
bumping it in Trevor's queue (sorry for the spam)
Comment 2 Trevor Saunders (:tbsaunde) 2012-05-22 05:55:21 PDT
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?
Comment 3 alexander :surkov 2012-05-22 06:07:51 PDT
(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.
Comment 5 Ryan VanderMeulen [:RyanVM] 2012-05-26 05:09:48 PDT
https://hg.mozilla.org/mozilla-central/rev/8da4ff25a24a

Note You need to log in before you can comment on or make changes to this bug.