From 2064ff736f44b4b4216c7dddd27991bd6e216c8f Mon Sep 17 00:00:00 2001 From: "timeless@mozdev.org" Date: Wed, 28 Apr 2010 17:55:00 -0700 Subject: [PATCH] Bug 562525 - nsPropertiesParser::FinishValueState potentially uses a variable uninitialized dependent on a member of a class in a file with threadsafe classes, r=bsmedberg --HG-- extra : rebase_source : 56cb882be1612a7975f1d845e7a8b96e2ab0d060 --- xpcom/ds/nsPersistentProperties.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xpcom/ds/nsPersistentProperties.cpp b/xpcom/ds/nsPersistentProperties.cpp index 6cd71c7cc75..b8411702b50 100644 --- a/xpcom/ds/nsPersistentProperties.cpp +++ b/xpcom/ds/nsPersistentProperties.cpp @@ -128,14 +128,15 @@ public: // 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;