Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cov-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
## Use the parameter below to add comments for issues filtered
## by impact. Default is High if unset
## NOTE: Issues matching coverity_policy_view are ignored if set
# coverity_prComment_impacts: 'High,Medium,Low,Audit'
coverity_prComment_impacts: 'High,Medium,Low,Audit'
github_token: ${{ secrets.GITHUB_TOKEN }} # Required when PR comments is enabled

### Mark build status if policy violating issues are found
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/HelloWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,14 @@ public static void main(String[] args) {
catch (Exception e) { System.out.println("Something went wrong."); }
System.out.println("Hello World!");
}
public static int badidea() {
int a = 1;
int b = 0;
int c = a/b;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-generated PR comment (Coverity)

Coverity Issue - Division or modulo by zero

Priority: Medium
Vulnerability: CWE-369
CID: 10019

View in Coverity Connect

In expression "a / b", division by expression "b" which may be zero results in an exception.

The program will raise an exception.


for (int i=0; i<a; i--) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-generated PR comment (Coverity)

Coverity Issue - Infinite loop

Priority: Medium
Vulnerability: CWE-835
CID: 10020

View in Coverity Connect

Top of the loop.

The loop does not have a normal termination condition, so will continue until an abnormal condition arises.

System.out.println("whoops");
}
return c;
}
}
Loading