Task #145937 - fixed.err
back to task #145937download
Error: CPPCHECK_WARNING (CWE-476):
subscription-manager-1.30.16/src/plugins/libdnf/product-id.c:165: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: repoProductId
# 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):
subscription-manager-1.30.16/src/plugins/libdnf/product-id.c: scope_hint: In function ‘initRepoProductId’
subscription-manager-1.30.16/src/plugins/libdnf/product-id.c:165:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘repoProductId’
subscription-manager-1.30.16/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: CPPCHECK_WARNING (CWE-476):
subscription-manager-1.30.16/src/plugins/libdnf/product-id.c:166: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: repoProductId
# 164| RepoProductId *repoProductId = (RepoProductId*) malloc(sizeof(RepoProductId));
# 165| repoProductId->repo = NULL;
# 166|-> repoProductId->productIdPath = NULL;
# 167| repoProductId->isInstalled = FALSE;
# 168| return repoProductId;
Error: CPPCHECK_WARNING (CWE-476):
subscription-manager-1.30.16/src/plugins/libdnf/product-id.c:167: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: repoProductId
# 165| repoProductId->repo = NULL;
# 166| repoProductId->productIdPath = NULL;
# 167|-> repoProductId->isInstalled = FALSE;
# 168| return repoProductId;
# 169| }
Error: COMPILER_WARNING (CWE-704):
subscription-manager-1.30.16/src/plugins/libdnf/product-id.c: scope_hint: In function ‘findProductId’
subscription-manager-1.30.16/src/plugins/libdnf/product-id.c:1043:31: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 1041| for (int i = 0; i < exts; i++) {
# 1042| char oid[MAX_BUFF];
# 1043|-> X509_EXTENSION *ext = X509_get_ext(x509, i);
# 1044| if (ext == NULL) {
# 1045| debug("Failed to get extension of X509 structure: %s",
Error: CPPCHECK_WARNING (CWE-476):
subscription-manager-1.30.16/src/plugins/libdnf/productdb.c:34: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: 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
Error: GCC_ANALYZER_WARNING (CWE-476):
subscription-manager-1.30.16/src/plugins/libdnf/productdb.c: scope_hint: In function ‘initProductDb’
subscription-manager-1.30.16/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
Error: CPPCHECK_WARNING (CWE-476):
subscription-manager-1.30.16/src/plugins/libdnf/productdb.c:37: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: productDb
# 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
# 37|-> productDb->repoMap = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
# 38| return productDb;
# 39| }