Closed Bug 329159 Opened 18 years ago Closed 18 years ago

StringIndexOutOfBoundsException in Mozilla.getGREPathFromRegistryFile

Categories

(Core Graveyard :: Java to XPCOM Bridge, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jhpedemonte, Assigned: jhpedemonte)

Details

(Keywords: fixed1.8.1, verified1.8.0.5)

Attachments

(2 files)

On some Windows machines, when calling Mozilla.getGREPathWithProperties(), the user gets an exception:

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(Unknown Source)
	at java.lang.String.substring(Unknown Source)
	at org.mozilla.xpcom.Mozilla.getGREPathFromRegistryFile(Mozilla.java:344)
	at org.mozilla.xpcom.Mozilla.main(Mozilla.java:885)
Attached file jx-registry.bad
This is the file created as a result of running 'regedit /e jx-registry.bad "HKEY_LOCAL_MACHINE\\Software\\mozilla.org\\GRE"' in the Mozilla.getGREPathWithProperties().  Parsing this file results in an exception.
Attached patch patchSplinter Review
The key Software\mozilla.org\GRE can itself have values, and will therefore be returned by the INIParser.  So we just use the key length to skip over this key.
Attachment #213808 - Flags: review?(benjamin)
Comment on attachment 213808 [details] [diff] [review]
patch

r=mkaply
Attachment #213808 - Flags: review?(benjamin) → review+
Checked in to trunk. -> FIXED
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Keywords: fixed1.8.1
Comment on attachment 213808 [details] [diff] [review]
patch

Asking for 1.8.0.5 approval.  XULRunner only.  This patch fixes an exception that a few people are seeing.  Would be good to get in to the XULRunner 1.8.0.x nightlies.
Attachment #213808 - Flags: approval1.8.0.5?
Comment on attachment 213808 [details] [diff] [review]
patch

approved for 1.8.0 branch, a=dveditz for drivers
Attachment #213808 - Flags: approval1.8.0.5? → approval1.8.0.5+
Flags: blocking1.8.0.5+
Checked in to 1.8.0.5.
Keywords: fixed1.8.0.5
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: