Fixed findings

List of Findings

Error: COMPILER_WARNING: [#def1]
rpm-6.0.1/lib/fsm.cc: scope_hint: In function ‘void removeSBITS(int, const char*)’
rpm-6.0.1/lib/fsm.cc:478:13: warning[-Wunused-but-set-variable=]: variable ‘rc’ set but not used
#  478 |         int rc = 0;
#      |             ^~
#  476|       if (fstatat(dirfd, path, &stb, flags) == 0 && S_ISREG(stb.st_mode)) {
#  477|   	/* XXX TODO: actually check for the rc, but what to do there? */
#  478|-> 	int rc = 0;
#  479|   	/* We now know it's not a link so no need to worry about following */
#  480|   	if ((stb.st_mode & 06000) != 0) {

Error: CPPCHECK_WARNING (CWE-476): [#def2]
rpm-6.0.1/lib/tagexts.cc:907: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: e
#  905|       if (!headerGet(h, RPMTAG_EPOCH, td, HEADERGET_ALLOC)) {
#  906|   	uint32_t *e = (uint32_t *)malloc(sizeof(*e));
#  907|-> 	*e = 0;
#  908|   	td->data = e;
#  909|   	td->type = RPM_INT32_TYPE;

Error: CPPCHECK_WARNING (CWE-476): [#def3]
rpm-6.0.1/tools/rpmdump.cc:137: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: blob
#  135|   
#  136|       blob = (uint32_t *)malloc(sizeof(numEntries) + sizeof(numBytes) + headerLen);
#  137|->     blob[0] = htonl(numEntries);
#  138|       blob[1] = htonl(numBytes);
#  139|   

Error: CPPCHECK_WARNING (CWE-476): [#def4]
rpm-6.0.1/tools/rpmdump.cc:138: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: blob
#  136|       blob = (uint32_t *)malloc(sizeof(numEntries) + sizeof(numBytes) + headerLen);
#  137|       blob[0] = htonl(numEntries);
#  138|->     blob[1] = htonl(numBytes);
#  139|   
#  140|       pe = (struct entryInfo *) &(blob[2]);

Error: CPPCHECK_WARNING (CWE-682): [#def5]
rpm-6.0.1/tools/rpmdump.cc:148: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  146|   
#  147|       
#  148|->     if (read(fd, blob+2, headerLen) != headerLen) {
#  149|   	fprintf(stderr, "reading %d bytes of header fail\n", headerLen);
#  150|   	goto exit;

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-147.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-namerpm-6.0.92-2.fc45
diffbase-store-results-to/tmp/tmp8nfvsdgt/rpm-6.0.92-2.fc45.tar.xz
diffbase-time-created2026-08-03 20:41:02
diffbase-time-finished2026-08-03 20:43:26
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmp8nfvsdgt/rpm-6.0.92-2.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp8nfvsdgt/rpm-6.0.92-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-147.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-namerpm-6.0.1-2.fc44
store-results-to/tmp/tmpaw05416_/rpm-6.0.1-2.fc44.tar.xz
time-created2026-08-03 20:37:37
time-finished2026-08-03 20:40:49
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpaw05416_/rpm-6.0.1-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpaw05416_/rpm-6.0.1-2.fc44.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9