Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Coverity issue in ProcessInfo.cpp #1786

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

scthunderbolt
Copy link
Contributor

No description provided.

@rdkcmf-jenkins
Copy link

Coverity Issue - Logically dead code

Execution cannot reach this statement: "buffer[index] = '\0';".

Medium Impact, CWE-561
DEADCODE

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
Source/core/ProcessInfo.cpp:573

@rdkcmf-jenkins
Copy link

Coverity Issue - Logically dead code

Execution cannot reach this statement: "buffer[index] = c;".

Medium Impact, CWE-561
DEADCODE

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
Source/core/ProcessInfo.cpp:555

@@ -546,7 +546,8 @@ namespace Core {
char buffer[bufferSize];
while (true) {
char c;
size_t readChars = fread(&c, 1, 1, cmdFile);
size_t readChars = 0;
fread(&c, 1, 1, cmdFile);

Choose a reason for hiding this comment

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

Coverity Issue - Ignoring number of bytes read

"fread(void *, size_t, size_t, FILE *)" returns the number of bytes read, but it is ignored.

Medium Impact, CWE-252
CHECKED_RETURN

Copy link
Contributor

@pwielders pwielders left a comment

Choose a reason for hiding this comment

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

This breaks functionality! Do not merge, but I guess, from the comments, it is just to test coverity and there is no need to merge this..

@pwielders pwielders added the invalid This doesn't seem right label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants