Skip to content
This repository was archived by the owner on Feb 20, 2023. It is now read-only.
This repository was archived by the owner on Feb 20, 2023. It is now read-only.

A kind of potential NullPointerException bugs in method tokenizeToStringArray #468

Open
@JulyChen728

Description

@JulyChen728

Hi all,

Our tool has found one kind of potential NPE bugs caused by returning null in method tokenizeToStringArray.

There are several points that use the null value, including:

  1. assigned to variable pathParts in method extractPathWithinPattern and used it by pathParts.length in method extractPathWithinPattern

  2. assigned to variable patternParts in method extractPathWithinPattern and used it by pathParts.length in method extractPathWithinPattern

  3. the null value is returned by method tokenizePath. There are still several points that use this null value, including:
    3.1. assigned to variable pathDirs in method doMatch and used it by pathDirs.length - 1 in method doMatch
    3.2. assigned to variable tokenized in method tokenizePattern and assigned to variable pattDirs by String[] pattDirs = tokenizePattern(pattern); in method doMatch. Finally, it is used by pattDirs.length - 1;

Thanks.

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