mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 710975 - Bad index checking in nsIEProfileMigrator::TestForIE7(). r=gavin
This commit is contained in:
parent
876c18b050
commit
d386d01d3c
@ -99,6 +99,8 @@
|
||||
#include "nsIWindowsRegKey.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
|
||||
#define kNotFound -1
|
||||
|
||||
#define TRIDENTPROFILE_BUNDLE "chrome://browser/locale/migration/migration.properties"
|
||||
|
||||
#define REGISTRY_IE_MAIN_KEY \
|
||||
@ -602,9 +604,13 @@ nsIEProfileMigrator::TestForIE7()
|
||||
|
||||
iePath = destination;
|
||||
|
||||
// Check if the path is enclosed in quotation marks.
|
||||
if (StringBeginsWith(iePath, NS_LITERAL_STRING("\""))) {
|
||||
iePath.Cut(0,1);
|
||||
PRUint32 index = iePath.FindChar('\"', 0);
|
||||
PRInt32 index = iePath.FindChar('\"', 0);
|
||||
|
||||
// After removing the opening quoation mark,
|
||||
// remove the closing one and everything after it.
|
||||
if (index > 0)
|
||||
iePath.Cut(index,iePath.Length());
|
||||
}
|
||||
@ -621,8 +627,8 @@ nsIEProfileMigrator::TestForIE7()
|
||||
return false;
|
||||
|
||||
if (ieVersion.Length() > 2) {
|
||||
PRUint32 index = ieVersion.FindChar('.', 0);
|
||||
if (index < 0)
|
||||
PRInt32 index = ieVersion.FindChar('.', 0);
|
||||
if (index == kNotFound)
|
||||
return false;
|
||||
ieVersion.Cut(index, ieVersion.Length());
|
||||
PRInt32 ver = wcstol(ieVersion.get(), nsnull, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user