RTEMS | bdpart-register.c: Calling close() with negative value (#5113)
Joel Sherrill (@joel)
gitlab at rtems.org
Thu Aug 8 21:41:10 UTC 2024
Joel Sherrill created an issue: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5113
## Summary
Coverity CID 1467408
At line 212, close() is called and fd can potentially be negative. The simplest way to address this is to add a check for "fd >= 0" before calling close().
```
209cleanup:
210
211 free( logical_disk_name);
CID 1467408: (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
5. negative_returns: fd is passed to a parameter that cannot be negative. [Note: The source code implementation of the function has been overridden by a builtin model.]
212 close( fd);
```
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5113
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240808/3544fc2d/attachment.htm>
More information about the bugs
mailing list