Bug 562525 - nsPropertiesParser::FinishValueState potentially uses a variable uninitialized dependent on a member of a class in a file with threadsafe classes, r=bsmedberg
authortimeless@mozdev.org
Wed, 28 Apr 2010 17:55:00 -0700
changeset 41750 caad36ecabef251e55efe863dfcf13467381d737
parent 41749 ab5f66865563cba7952b339f6d91211471d1b5b2
child 41751 7939af53a1d16eebdcf7b84a16c5ffc5caf33e1b
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs562525
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 562525 - nsPropertiesParser::FinishValueState potentially uses a variable uninitialized dependent on a member of a class in a file with threadsafe classes, r=bsmedberg
xpcom/ds/nsPersistentProperties.cpp
--- a/xpcom/ds/nsPersistentProperties.cpp
+++ b/xpcom/ds/nsPersistentProperties.cpp
@@ -123,24 +123,25 @@ public:
     mProps(aProps) {}
 
   void FinishValueState(nsAString& aOldValue) {
     static const char trimThese[] = " \t";
     mKey.Trim(trimThese, PR_FALSE, PR_TRUE);
 
     // This is really ugly hack but it should be fast
     PRUnichar backup_char;
-    if (mMinLength)
+    PRUint32 minLength = mMinLength;
+    if (minLength)
     {
-      backup_char = mValue[mMinLength-1];
-      mValue.SetCharAt('x', mMinLength-1);
+      backup_char = mValue[minLength-1];
+      mValue.SetCharAt('x', minLength-1);
     }
     mValue.Trim(trimThese, PR_FALSE, PR_TRUE);
-    if (mMinLength)
-      mValue.SetCharAt(backup_char, mMinLength-1);
+    if (minLength)
+      mValue.SetCharAt(backup_char, minLength-1);
 
     mProps->SetStringProperty(NS_ConvertUTF16toUTF8(mKey), mValue, aOldValue);
     mSpecialState = eParserSpecial_None;
     WaitForKey();
   }
 
   EParserState GetState() { return mState; }