All Coverity detected defects fixed in backend code

Coverity Scan is a static code analysis service provided by Synopsys free of charge for open source projects. It detects defects like

The GitHub project wfjm/w11 was registered on 2018-08-21 with Coverity Scan as project wfjm-w11. The C++ backend codebase (under tools/src) is since then submitted to Coverity Scan after each significant code update. During the whole time, Coverity Scan version 2017.07 was used.

Fig 1: Status on 2019-06-14 with Coverity Scan version 2017.07.

The initial scan done on 2018-09-14 found a moderate number of defects. A closer investigation showed that most of them are indeed bad coding but will not lead to operational problems. However, some of the defects were genuine bugs, which only by chance didn't create malfunctions up to now.

The last defect was fixed on 2019-06-14 with commit c858427, at this point, the wfjm-w11 codebase was free of defects.

The following table summarizes the defects detected by Coverity Scan and indicates how the case was resolved

The comment column highlights the few cases where Coverity Scan detected a hard bug that just by chance didn't cause operational problems before detection by the code analysis.

Class Status Fix-Date Commit Comment
uninitialized scalar
Rw11RdmaDisk.cpp:55 FIXED 2018-09-16 c01fc7c
Rw11VirtDiskFile.cpp:53 FIXED 2018-09-16 c01fc7c
RtclRlinkConnect.cpp:* FIXED 2018-09-16 c01fc7c
RtclRw11Cpu.cpp:* FIXED 2018-09-21 c01fc7c
RlinkPortTerm.cpp:69 FIXED 2018-09-21 a369c48
RlinkCommandList.cpp:69 FIXED 2018-09-16 c01fc7c
RtclArgs.cpp:98 FIXED 2018-09-16 c01fc7c
uninitialized pointer
RtclClassBase.cpp:60 FIXED 2018-09-16 c01fc7c
RtclProxyBase.cpp:58 FIXED 2018-09-16 c01fc7c
uncaught exception
RlinkConnect.cpp:164 FIXED 2018-10-27 86380fc
RlinkServer.cpp:108 FIXED 2018-10-27 86380fc
RlinkPortCuff.cpp:87 FIXED 2018-10-27 86380fc
Rw11VirtEthTap.cpp:63 FIXED 2018-10-27 86380fc
Rw11VirtTermTcp.cpp:104 FIXED 2018-10-27 86380fc
Rw11VirtTermPty.cpp:59 FIXED 2018-10-27 86380fc
RlinkServer.cpp:108 FIXED 2018-10-27 86380fc
RtclAttnShuttle.cpp:70 FIXED 2018-10-27 86380fc
resource leak
Rw11VirtDiskFile.cpp:92 FIXED 2018-09-22 700eb23 BUGFIX - leaked file id's under some conditions
Rw11VirtTapeTap.cpp:137 FIXED 2018-09-22 700eb23
Rw11CntlDEUNA.cpp:414 FIXED 2018-09-22 700eb23 BUGFIX - weak resource leak
structurally dead code
Rw11Cpu.cpp:291 FIXED 2018-09-22 700eb23
locally dead code
RlinkPacketBufRcv.cpp:102 FIXED 2019-06-14 c858427
Rw11CntlRHRP.cpp:587 IGNORE 2019-06-14 c858427
out-of-bounds read
RiosState.cpp:95 FALSPOS 2018-10-27
operands don't affect result
Rw11VirtTapeTap.cpp:426 FIXED 2018-09-22 700eb23
buffer not null-terminated
Rw11VirtEthTap.cpp:93 FIXED 2018-10-27 2a50d35 BUGFIX - string wasn't null-terminated
argument in wrong order
RtclArgs.cpp:247 FIXED 2018-09-22 700eb23 BUGFIX - faulty defaults
unchecked return value
RtclCmdBase.cpp:88 IGNORE 2018-09-22 700eb23
time of check, time of use
Rtools.cpp:133 IGNORE 2018-10-29 0913863
RlinkPortFifo.cpp:98 IGNORE 2018-10-29 0913863