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

[V0.10] Coverity fixes #3423

Draft
wants to merge 9 commits into
base: v0.10
Choose a base branch
from

Conversation

matt335672
Copy link
Member

Backports of the following devel PRs:-

#3421
#3422

Draft for now, so a few more can be added. None of these look crucial at the moment.

@matt335672
Copy link
Member Author

2025-02-11: Needs rebasing - see #3427

Add additional check to prevent Coverity assuming the worst

(cherry picked from commit db32f9c)
1) file descriptors cannot be zero when not in use.

2) Coverity seems to have some problems with the loop(s) copying data
   from one socket to another, in that it assumes that eventually an
   integer overflow will occur. It's not obvious why this should be
   flagged, but this seems likely to be a false positive.

   This commit avoids the integer issue by using a simple pointer + count
   mechanism.

The socket copy code has been placed in a separate function - before it
was duplicated. Minor fixes have been made to error reporting around the
connection code.

(cherry picked from commit 1/3 2d29342)
(cherry picked from commit 2/3 c122e05)
(cherry picked from commit 3/3 e169733)
(cherry picked from commit eff8ba7)
(cherry picked from commit b7a94bd)
(cherry picked from commit f7543c2)
This Coverity issue was encountered in a private build, but does not
appear to be in the Github CI build. Coverity is suspecting a copy-paste
betweem these lines in sound.c:-

1838: xstream_copyin(s, &g_stream_inp->data[g_stream_inp->size - g_bytes_in_stream], i);
1844: xstream_copyin(s, &g_stream_inp->data[g_stream_inp->size - g_bytes_in_stream], g_bytes_in_stream);

An inspection of the code shows this to bre a false positive

(cherry picked from commit 6088ba3)
(cherry picked from commit cb90458)
(cherry picked from commit 8769481)
(cherry picked from commit f376196)
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