Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:25:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:18:15: acquire_memory: this call could return NULL
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:23:15: branch_true: following ‘true’ branch (when ‘i < <unknown>’)...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:24:13: branch_true: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:24:8: branch_true: following ‘true’ branch...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:25:8: branch_true: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:25:7: danger: ‘p’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   23|     for (i = 0; i < bytes.len; i++) {
#   24|       if (data[i] >= 32 && data[i] != 127) {
#   25|->       *p++ = data[i];
#   26|       } else {
#   27|         *p++ = '\\';

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:27:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:18:15: acquire_memory: this call could return NULL
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:23:15: branch_true: following ‘true’ branch (when ‘i < <unknown>’)...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:24:13: branch_true: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:24:8: branch_false: following ‘false’ branch...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:27:7: branch_false: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:27:7: danger: ‘p’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   25|         *p++ = data[i];
#   26|       } else {
#   27|->       *p++ = '\\';
#   28|         *p++ = '0' + (data[i] >> 6);
#   29|         *p++ = '0' + (data[i] >> 3 & 0x7);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def3]
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:34:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:18:15: acquire_memory: this call could return NULL
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:23:15: branch_false: following ‘false’ branch (when ‘i >= <unknown>’)...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:34:3: branch_false: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/consume.c:34:3: danger: ‘p’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   32|     }
#   33|   
#   34|->   *p = 0;
#   35|     return res;
#   36|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def4]
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:122:26: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(32768)’ where non-null expected
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:69:6: branch_false: following ‘false’ branch...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:74:7: branch_false: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:74:6: branch_false: following ‘false’ branch...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:79:7: branch_false: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:79:6: branch_false: following ‘false’ branch...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:84:7: branch_false: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:84:6: branch_false: following ‘false’ branch...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:114:10: branch_false: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:116:6: branch_false: following ‘false’ branch...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:119:9: branch_false: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:119:8: branch_true: following ‘true’ branch...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:120:34: branch_true: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:120:34: acquire_memory: this call could return NULL
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:121:14: branch_true: following ‘true’ branch...
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:122:26: branch_true: ...to here
rabbitmq-c-84b81cd97a1b5515d3d4b304796680da24c666d8/tools/publish.c:122:26: danger: argument 1 (‘malloc(32768)’) from [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12) could be NULL where non-null expected
#  120|         body_bytes.bytes = (char *)malloc(MAX_LINE_LENGTH);
#  121|         while (fgets(body_bytes.bytes, MAX_LINE_LENGTH, stdin)) {
#  122|->         body_bytes.len = strlen(body_bytes.bytes);
#  123|           do_publish(conn, exchange, routing_key, &props, body_bytes);
#  124|         }

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.97.1
diffbase-analyzer-version-cppcheck2.21.1
diffbase-analyzer-version-gcc16.1.1
diffbase-analyzer-version-gcc-analyzer16.1.1
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-16.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.20260524.213755.g3c6d0be.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namelibrabbitmq-0.17.0-2.fc45
diffbase-store-results-to/tmp/tmpluxyjzse/librabbitmq-0.17.0-2.fc45.tar.xz
diffbase-time-created2026-08-03 17:48:21
diffbase-time-finished2026-08-03 17:49:29
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpluxyjzse/librabbitmq-0.17.0-2.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpluxyjzse/librabbitmq-0.17.0-2.fc45.src.rpm'
diffbase-tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-16.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibrabbitmq-0.15.0-4.fc44
store-results-to/tmp/tmpv7kp3_6g/librabbitmq-0.15.0-4.fc44.tar.xz
time-created2026-08-03 17:45:57
time-finished2026-08-03 17:47:55
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpv7kp3_6g/librabbitmq-0.15.0-4.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpv7kp3_6g/librabbitmq-0.15.0-4.fc44.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9