Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
subscription-manager-1.30.5-build/subscription-manager-1.30.5/src/plugins/libdnf/product-id.c: scope_hint: In function ‘initRepoProductId’
subscription-manager-1.30.5-build/subscription-manager-1.30.5/src/plugins/libdnf/product-id.c:165:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘repoProductId’
subscription-manager-1.30.5-build/subscription-manager-1.30.5/src/plugins/libdnf/product-id.c:15: included_from: Included from here.
/usr/include/glib-2.0/glib.h:33: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
/usr/include/libdnf/dnf-types.h:27: included_from: Included from here.
/usr/include/libdnf/plugin/plugin.h:24: included_from: Included from here.
#  163|   RepoProductId *initRepoProductId(void) {
#  164|       RepoProductId *repoProductId = (RepoProductId*) malloc(sizeof(RepoProductId));
#  165|->     repoProductId->repo = NULL;
#  166|       repoProductId->productIdPath = NULL;
#  167|       repoProductId->isInstalled = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
subscription-manager-1.30.5-build/subscription-manager-1.30.5/src/plugins/libdnf/productdb.c: scope_hint: In function ‘initProductDb’
subscription-manager-1.30.5-build/subscription-manager-1.30.5/src/plugins/libdnf/productdb.c:34:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘productDb’
#   32|   ProductDb *initProductDb() {
#   33|       ProductDb *productDb = malloc(sizeof(ProductDb));
#   34|->     productDb->path = NULL;
#   35|       // We do not provide method for freeing value, because it would be ineficient to
#   36|       // free and recreate GSList everytime we add/remove item in the list

Scan Properties

analyzer-version-clippy1.84.1
analyzer-version-cppcheck2.16.2
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.84.1
diffbase-analyzer-version-cppcheck2.16.2
diffbase-analyzer-version-gcc15.0.1
diffbase-analyzer-version-gcc-analyzer15.0.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-163.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namesubscription-manager-1.30.5-1.20250214144948287816.pr3509.11.ga32e4163b
diffbase-store-results-to/tmp/tmp00x20y_n/subscription-manager-1.30.5-1.20250214144948287816.pr3509.11.ga32e4163b.tar.xz
diffbase-time-created2025-02-14 15:01:25
diffbase-time-finished2025-02-14 15:02:41
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,clippy,shellcheck,gcc,unicontrol' '-o' '/tmp/tmp00x20y_n/subscription-manager-1.30.5-1.20250214144948287816.pr3509.11.ga32e4163b.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '/tmp/tmp00x20y_n/subscription-manager-1.30.5-1.20250214144948287816.pr3509.11.ga32e4163b.src.rpm'
diffbase-tool-versioncsmock-3.8.0-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-163.us-west-2.compute.internal
mock-configfedora-rawhide-x86_64
project-namesubscription-manager-1.30.5-1.20250213142301532877.main.10.gd5094fbfe
store-results-to/tmp/tmpu98zrulo/subscription-manager-1.30.5-1.20250213142301532877.main.10.gd5094fbfe.tar.xz
time-created2025-02-14 14:58:58
time-finished2025-02-14 15:00:48
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,clippy,shellcheck,gcc,unicontrol' '-o' '/tmp/tmpu98zrulo/subscription-manager-1.30.5-1.20250213142301532877.main.10.gd5094fbfe.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '/tmp/tmpu98zrulo/subscription-manager-1.30.5-1.20250213142301532877.main.10.gd5094fbfe.src.rpm'
tool-versioncsmock-3.8.0-1.el9