Skip to content

Math.abs(Integer.MIN_VALUE) will overflow and return a negative value #758

@SYaoJun

Description

@SYaoJun

Describe the bug

Substr.java

if ((Math.abs(pos) > str.length())) {
    return str;
}

Expected behavior

Math.abs(Integer.MIN_VALUE) will overflow
return a negative value

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