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

[Coverity CID :203505]Integer handling issues in /tests/lib/fdtable/src/main.c #18450

Closed
aasthagr opened this issue Aug 17, 2019 · 2 comments · Fixed by #21086
Closed

[Coverity CID :203505]Integer handling issues in /tests/lib/fdtable/src/main.c #18450

aasthagr opened this issue Aug 17, 2019 · 2 comments · Fixed by #21086
Labels
area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@aasthagr
Copy link
Collaborator

Static code scan issues seen in File: /tests/lib/fdtable/src/main.c
Category: Integer handling issues
Function: test_z_reserve_fd
Component: Tests
CID: 203505
Please fix or provide comments to square it off in coverity in the link: https://scan9.coverity.com/reports.htm#v32951/p12996

@aasthagr aasthagr added area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix labels Aug 17, 2019
@aasthagr
Copy link
Collaborator Author

*** CID 203505:  Integer handling issues  (NEGATIVE_RETURNS)
/tests/lib/fdtable/src/main.c: 18 in test_z_reserve_fd()
12     void test_z_reserve_fd(void)
13     {
14     	int fd = z_reserve_fd(); /* function being tested */
15     
16     	zassert_equal(fd >= 0, true, "fd < 0");
17     
>>>     CID 203505:  Integer handling issues  (NEGATIVE_RETURNS)
>>>     "fd" is passed to a parameter that cannot be negative.
18     	z_free_fd(fd);
19     }
20     
21     void test_z_get_fd_obj_and_vtable(void)
22     {
23     	const struct fd_op_vtable *vtable;

@galak galak added the priority: low Low impact/importance bug label Aug 18, 2019
@keylime-unicorn keylime-unicorn removed their assignment Oct 29, 2019
@aescolar
Copy link
Member

f1afb4c

nashif added a commit to nashif/zephyr that referenced this issue Nov 29, 2019
Check for negative file descriptor.

Fixes zephyrproject-rtos#18448
Fixes zephyrproject-rtos#18450
Fixes zephyrproject-rtos#18449
Fixes zephyrproject-rtos#18451

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
nashif added a commit that referenced this issue Dec 2, 2019
Check for negative file descriptor.

Fixes #18448
Fixes #18450
Fixes #18449
Fixes #18451

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants