#1791 Unchecked return value in files.c
Closed: Fixed None Opened 6 years ago by mzidek.

Found by Coverity. We check return value from closedir on other places in the code, but here not.

No check of the return value of "closedir(dir)".
678    if (dir) closedir(dir);

Right, it was pointed out during the code review of the patch that introduced the bug that it's pointless to check the return code b/c there's nothing we can do about an error anyway.

But we should be silencing Coverity, please check the return value and issue a SSSDBG_MINOR_FAILURE warning. Please be careful not to overwrite ret.

Fields changed

patch: 0 => 1

Fields changed

owner: somebody => mzidek
status: new => assigned
version: 1.9.3 => 1.9.4

milestone: NEEDS_TRIAGE => SSSD 1.10 beta
resolution: => fixed
status: assigned => closed

Fields changed

rhbz: => 0

There seems to be another occurrence in files.c:

781 done:
At conditional (8): "dir" taking the true branch.
CID 13129: Unchecked return value (CHECKED_RETURN)Calling function "closedir" without checking return value (as is done elsewhere 4 out of 5 times).
No check of the return value of "closedir(dir)".
782    if (dir) closedir(dir);
783
784    if (dest_dir_fd != -1) {
785        close(dest_dir_fd);
786    }
787    return ret;
788}

resolution: fixed =>
status: closed => reopened

Also pushed to sssd-1-9: 1117cf6

milestone: SSSD 1.10 beta => SSSD 1.9.5
resolution: => fixed
status: reopened => closed

Metadata Update from @mzidek:
- Issue assigned to mzidek
- Issue set to the milestone: SSSD 1.9.5

2 years ago

Login to comment on this ticket.

Metadata