Closed Bug 54668 Opened 24 years ago Closed 24 years ago

mNextDependeeIdx is not initialized in nsComponent.cpp

Categories

(SeaMonkey :: Installer, defect, P3)

All
Other
defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9

People

(Reporter: jdunn, Assigned: samir_bugzilla)

References

Details

(Whiteboard: [xpibug])

mozilla/xpinstall/wizard/unix/src2/nsComponent.cpp

It turns out the member variable for the array index is
NOT initialized to 0.  While some compilers/OS's might automatically
default, this behavior is NOT guarenteed.
Here is a sample diff.

Index: nsComponent.cpp
===================================================================
RCS file: /cvsroot/mozilla/xpinstall/wizard/unix/src2/nsComponent.cpp,v
retrieving revision 1.4
diff -c -r1.4 nsComponent.cpp
*** nsComponent.cpp     2000/05/10 22:44:48     1.4
--- nsComponent.cpp     2000/09/29 13:27:47
***************
*** 41,46 ****
--- 41,48 ----
          mURL[i] = NULL;
      for (i = 0; i < MAX_COMPONENTS; i++)
          mDependees[i] = NULL;
+
+     mNextDependeeIdx = 0;
  }

  nsComponent::~nsComponent()
***************
*** 54,59 ****
--- 56,63 ----
          XI_IF_FREE(mURL[i]);
      for (i = 0; i < MAX_COMPONENTS; i++)
          XI_IF_FREE(mDependees[i]);
+
+     mNextDependeeIdx = 0;
  }

  nsComponent *
Blocks: 18687, 18688
QA Contact: gemal → gbush
reassigning to Samir.
Assignee: ssu → sgehani
Ummm, sure, r=sgehani.
Assignee: sgehani → jdunn
Status: NEW → ASSIGNED
Reassigning per earlier comment, or Jim can check it in.
Assignee: jdunn → sgehani
Status: ASSIGNED → NEW
Keywords: nsbeta1, patch
Whiteboard: [xpibug]
Moz 0.9 tasks
Target Milestone: --- → mozilla0.9
Keywords: nsbeta1nsbeta1+
sr=mscott
Fix checked in.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
verified code fix
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.