Skip to content

Possible SIOOBE in Accessible.getStringForRangeParameterizedAttribute #3339

@tmssngr

Description

@tmssngr

Describe the bug
A user of SmartGit reported following exception on MacOS 15.7.4/aarch64:

java.lang.StringIndexOutOfBoundsException: Range [0, 2000) out of bounds for length 38
	at java.base/jdk.internal.util.Preconditions$1.apply(SourceFile:55)
	at java.base/jdk.internal.util.Preconditions$1.apply(SourceFile:52)
	at java.base/jdk.internal.util.Preconditions$4.apply(SourceFile:213)
	at java.base/jdk.internal.util.Preconditions$4.apply(SourceFile:210)
	at java.base/jdk.internal.util.Preconditions.outOfBounds(SourceFile:98)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(SourceFile:112)
	at java.base/jdk.internal.util.Preconditions.checkFromToIndex(SourceFile:349)
	at java.base/java.lang.String.checkBoundsBeginEnd(SourceFile:4865)
	at java.base/java.lang.String.substring(SourceFile:2834)
	at org.eclipse.swt.accessibility.Accessible.getStringForRangeParameterizedAttribute(SourceFile:2621)
	at org.eclipse.swt.accessibility.Accessible.internal_accessibilityAttributeValue_forParameter(SourceFile:1296)
	at org.eclipse.swt.widgets.Control.accessibilityAttributeValue_forParameter(SourceFile:301)
	at org.eclipse.swt.widgets.Display.windowProc(SourceFile:6703)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper
	at org.eclipse.swt.widgets.Widget.callSuper(SourceFile:239)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(SourceFile:2407)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(SourceFile:2534)
	at org.eclipse.swt.widgets.Display.windowProc(SourceFile:6420)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper
	at org.eclipse.swt.widgets.Display.applicationSendEvent(SourceFile:5716)
	at org.eclipse.swt.widgets.Display.applicationProc(SourceFile:5856)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(SourceFile:117)
	at org.eclipse.swt.widgets.Display.readAndDispatch(SourceFile:4011)

The suspicous line: https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/bundles/org.eclipse.swt/Eclipse%20SWT%20Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java#L2621

To Reproduce
I don't know.

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions