Skip to content

excellent changes#2

Open
bd-swright wants to merge 2 commits intomasterfrom
newproblems
Open

excellent changes#2
bd-swright wants to merge 2 commits intomasterfrom
newproblems

Conversation

@bd-swright
Copy link
Copy Markdown
Owner

no need to review, this is great

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.

int b = 0;
int c = a/b;

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant