Fixed findings

List of Findings

Error: CPPCHECK_WARNING (CWE-457): [#def1]
libnbd-1.23.8/common/utils/vector.c:74: error[uninitvar]: Uninitialized variable: reqcap
#   72|        * fall back to the requested capacity.
#   73|        */
#   74|->     newcap = reqcap;
#   75|       newbytes = reqbytes;
#   76|     }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
libnbd-1.23.8/copy/multi-thread-copying.c:551:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<U81c8>.user_data’
libnbd-1.23.8/copy/multi-thread-copying.c:503:1: enter_function: entry to ‘finished_read’
libnbd-1.23.8/copy/multi-thread-copying.c:507:6: branch_false: following ‘false’ branch...
libnbd-1.23.8/copy/multi-thread-copying.c:513:3: branch_false: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:516:6: branch_false: following ‘false’ branch...
libnbd-1.23.8/copy/multi-thread-copying.c:537:14: call_function: inlined call to ‘is_power_of_2’ from ‘finished_read’
libnbd-1.23.8/copy/multi-thread-copying.c:537:14: branch_true: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:538:10: branch_true: following ‘true’ branch...
libnbd-1.23.8/copy/multi-thread-copying.c:540:20: branch_true: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:540:10: branch_true: following ‘true’ branch...
libnbd-1.23.8/copy/multi-thread-copying.c:545:12: branch_true: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:545:12: branch_false: following ‘false’ branch (when ‘last_is_zero == 0’)...
libnbd-1.23.8/copy/multi-thread-copying.c:547:14: branch_false: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:547:14: branch_true: following ‘true’ branch (when ‘last_offset != i’)...
libnbd-1.23.8/copy/multi-thread-copying.c:549:58: branch_true: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:548:26: call_function: calling ‘create_subcommand’ from ‘finished_read’
libnbd-1.23.8/copy/multi-thread-copying.c:548:26: return_function: returning to ‘finished_read’ from ‘create_subcommand’
libnbd-1.23.8/copy/multi-thread-copying.c:551:13: throw: if the called function throws an exception...
libnbd-1.23.8/copy/multi-thread-copying.c:551:13: danger: ‘<U81c8>.user_data’ leaks here; was allocated at [(23)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/22)
#  549|                                               last_offset, i - last_offset,
#  550|                                               false);
#  551|->             dst->ops->asynch_write (dst, newcommand,
#  552|                                       (nbd_completion_callback) {
#  553|                                         .callback = finished_command,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
libnbd-1.23.8/copy/multi-thread-copying.c:589:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<U8260>.user_data’
libnbd-1.23.8/copy/multi-thread-copying.c:503:1: enter_function: entry to ‘finished_read’
libnbd-1.23.8/copy/multi-thread-copying.c:507:6: branch_false: following ‘false’ branch...
libnbd-1.23.8/copy/multi-thread-copying.c:513:3: branch_false: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:516:6: branch_false: following ‘false’ branch...
libnbd-1.23.8/copy/multi-thread-copying.c:537:14: call_function: inlined call to ‘is_power_of_2’ from ‘finished_read’
libnbd-1.23.8/copy/multi-thread-copying.c:537:14: branch_true: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:584:8: branch_true: following ‘true’ branch (when ‘last_offset != i’)...
libnbd-1.23.8/copy/multi-thread-copying.c:585:10: branch_true: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:585:10: branch_false: following ‘false’ branch (when ‘last_is_zero == 0’)...
libnbd-1.23.8/copy/multi-thread-copying.c:587:54: branch_false: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:586:22: call_function: calling ‘create_subcommand’ from ‘finished_read’
libnbd-1.23.8/copy/multi-thread-copying.c:586:22: return_function: returning to ‘finished_read’ from ‘create_subcommand’
libnbd-1.23.8/copy/multi-thread-copying.c:589:9: throw: if the called function throws an exception...
libnbd-1.23.8/copy/multi-thread-copying.c:589:9: danger: ‘<U8260>.user_data’ leaks here; was allocated at [(19)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/18)
#  587|                                           last_offset, i - last_offset,
#  588|                                           false);
#  589|->         dst->ops->asynch_write (dst, newcommand,
#  590|                                   (nbd_completion_callback) {
#  591|                                     .callback = finished_command,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
libnbd-1.23.8/copy/multi-thread-copying.c:607:7: warning[-Wanalyzer-malloc-leak]: leak of ‘<U82f8>.user_data’
libnbd-1.23.8/copy/multi-thread-copying.c:503:1: enter_function: entry to ‘finished_read’
libnbd-1.23.8/copy/multi-thread-copying.c:507:6: branch_false: following ‘false’ branch...
libnbd-1.23.8/copy/multi-thread-copying.c:513:3: branch_false: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:516:6: branch_false: following ‘false’ branch...
libnbd-1.23.8/copy/multi-thread-copying.c:537:14: call_function: inlined call to ‘is_power_of_2’ from ‘finished_read’
libnbd-1.23.8/copy/multi-thread-copying.c:537:14: branch_true: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:605:8: branch_true: following ‘true’ branch (when ‘i != end’)...
libnbd-1.23.8/copy/multi-thread-copying.c:606:51: branch_true: ...to here
libnbd-1.23.8/copy/multi-thread-copying.c:606:20: call_function: calling ‘create_subcommand’ from ‘finished_read’
libnbd-1.23.8/copy/multi-thread-copying.c:606:20: return_function: returning to ‘finished_read’ from ‘create_subcommand’
libnbd-1.23.8/copy/multi-thread-copying.c:607:7: throw: if the called function throws an exception...
libnbd-1.23.8/copy/multi-thread-copying.c:607:7: danger: ‘<U82f8>.user_data’ leaks here; was allocated at [(17)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/16)
#  605|       if (end - i > 0) {
#  606|         newcommand = create_subcommand (command, i, end - i, false);
#  607|->       dst->ops->asynch_write (dst, newcommand,
#  608|                                 (nbd_completion_callback) {
#  609|                                   .callback = finished_command,

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-108.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namelibnbd-1.24.0-1.fc44
diffbase-store-results-to/tmp/tmpollf1uda/libnbd-1.24.0-1.fc44.tar.xz
diffbase-time-created2026-01-08 19:01:31
diffbase-time-finished2026-01-08 19:04:12
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpollf1uda/libnbd-1.24.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpollf1uda/libnbd-1.24.0-1.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-108.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibnbd-1.23.8-2.fc43
store-results-to/tmp/tmpm_a45c9b/libnbd-1.23.8-2.fc43.tar.xz
time-created2026-01-08 18:57:46
time-finished2026-01-08 19:00:58
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpm_a45c9b/libnbd-1.23.8-2.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpm_a45c9b/libnbd-1.23.8-2.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9