Skip to content

StringIndexOutOfBoundsException in Java/Maths/ParseInteger.java  #1345

Closed

Description

@pointhi

The function parseInt has a missing size check. This leads to a StringIndexOutOfBoundsException with the following reproducer:

parseInt("");

public static int parseInt(String s) {
if (s == null) {
throw new NumberFormatException("null");
}
boolean isNegative = s.charAt(0) == '-';

Activity

  1. deadshotsb commented on Jun 12, 2020

    @deadshotsb
    Member

    @yanglbme Kindly mention the pull request for which the issue was closed.

  2. added a commit that references this issue on Feb 16, 2024
    88d65ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions