Bug 203923 - makefs: Coverity CID 975621: False positive
Summary: makefs: Coverity CID 975621: False positive
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2015-10-21 12:43 UTC by scdbackup
Modified: 2017-11-05 20:47 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description scdbackup 2015-10-21 12:43:20 UTC

CID 975621 (#1 of 1): Copy-paste error (COPY_PASTE_ERROR)
   copy_paste_error: rf in fclose(rf) looks like a copy-paste error.
   Should it say fd instead?

471                        (void)fclose(rf);

--------------- Source analysis:

The suspicion stems from the assymetric reaction on error.
Only the read FILE pointer rf was opened inside the function.
So it gets closed in both error cases: with read FILE *rf and
with write FILE *fd.

          if (ferror(rf)) {
          if (ferror(fd)) {

--------------- Remedy proposal:

In Coverity classify CID 975621 as "False positive" and set its Action
to "Ignore".
Comment 1 Enji Cooper freebsd_committer 2015-10-25 22:13:00 UTC
Bulk taking makefs bugs.
Comment 2 Enji Cooper freebsd_committer 2017-11-05 20:47:23 UTC
Releasing bugs back to the pool.