Skip to content

V6: Use of assert statement risks uncaught AssertionError #465

@Shah91n

Description

@Shah91n

Description:
The code uses the assert statement, which throws an AssertionError (a subclass of Throwable, not Exception). Standard try...catch (Exception e) blocks will not catch this error. If an assertion fails and assertions are enabled at runtime, the uncaught AssertionError can propagate up, potentially terminating the service.

Root Cause:

  • AssertionError is not caught by catch (Exception e).

Impact:

  • If assertions are enabled in a production environment (intentionally or accidentally), a failing assertion can cause thread death or JVM termination.

Metadata

Metadata

Assignees

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