Error: GCC_ANALYZER_WARNING (CWE-476): [#def1] libdrm-2.4.123-build/libdrm-2.4.123/amdgpu/amdgpu_vamgr.c: scope_hint: In function ‘amdgpu_vamgr_init’ libdrm-2.4.123-build/libdrm-2.4.123/amdgpu/amdgpu_vamgr.c:56:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘n’ # 54| pthread_mutex_lock(&mgr->bo_va_mutex); # 55| n = calloc(1, sizeof(struct amdgpu_bo_va_hole)); # 56|-> n->size = mgr->va_max - start; # 57| n->offset = start; # 58| list_add(&n->list, &mgr->va_holes); Error: CPPCHECK_WARNING (CWE-401): [#def2] libdrm-2.4.123-build/libdrm-2.4.123/amdgpu/amdgpu_vamgr.c:87: error[memleak]: Memory leak: n # 85| hole->size -= (end_va - hole->offset); # 86| hole->offset = end_va; # 87|-> } else if (start_va > hole->offset) { # 88| hole->size = start_va - hole->offset; # 89| } else if (end_va - hole->offset < hole->size) { Error: COMPILER_WARNING: [#def3] libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr.c:34: included_from: Included from here. libdrm-2.4.123-build/libdrm-2.4.123/include/drm/i915_drm.h:2233:1: warning[-Wpacked]: packed attribute is unnecessary for ‘i915_context_engines_load_balance’ # 2233 | } __attribute__((packed)); # | ^ # 2231| # 2232| struct i915_engine_class_instance engines[]; # 2233|-> } __attribute__((packed)); # 2234| # 2235| #define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \ Error: COMPILER_WARNING: [#def4] libdrm-2.4.123-build/libdrm-2.4.123/include/drm/i915_drm.h:2271:1: warning[-Wpacked]: packed attribute is unnecessary for ‘i915_context_engines_bond’ # 2271 | } __attribute__((packed)); # | ^ # 2269| # 2270| struct i915_engine_class_instance engines[]; # 2271|-> } __attribute__((packed)); # 2272| # 2273| #define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \ Error: COMPILER_WARNING: [#def5] libdrm-2.4.123-build/libdrm-2.4.123/include/drm/i915_drm.h:2399:1: warning[-Wpacked]: packed attribute is unnecessary for ‘i915_context_engines_parallel_submit’ # 2399 | } __attribute__((packed)); # | ^ # 2397| struct i915_engine_class_instance engines[]; # 2398| # 2399|-> } __attribute__((packed)); # 2400| # 2401| #define I915_DEFINE_CONTEXT_ENGINES_PARALLEL_SUBMIT(name__, N__) struct { \ Error: COMPILER_WARNING: [#def6] libdrm-2.4.123-build/libdrm-2.4.123/include/drm/i915_drm.h:2473:1: warning[-Wpacked]: packed attribute is unnecessary for ‘i915_context_param_engines’ # 2473 | } __attribute__((packed)); # | ^ # 2471| #define I915_CONTEXT_ENGINES_EXT_PARALLEL_SUBMIT 2 /* see i915_context_engines_parallel_submit */ # 2472| struct i915_engine_class_instance engines[0]; # 2473|-> } __attribute__((packed)); # 2474| # 2475| #define I915_DEFINE_CONTEXT_PARAM_ENGINES(name__, N__) struct { \ Error: GCC_ANALYZER_WARNING (CWE-476): [#def7] libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c: scope_hint: In function ‘evict_lru’ libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c:553:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bo_fake’ libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c:39: included_from: Included from here. libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c:1018:17: note: in expansion of macro ‘DBG’ libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c:531:9: note: in expansion of macro ‘DBG’ # 551| # 552| set_dirty(&bo_fake->bo); # 553|-> bo_fake->block = NULL; # 554| # 555| free_block(bufmgr_fake, block, 0); Error: GCC_ANALYZER_WARNING (CWE-476): [#def8] libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c: scope_hint: In function ‘evict_mru’ libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c:576:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bo_fake’ libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c:1018:17: note: in expansion of macro ‘DBG’ libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c:531:9: note: in expansion of macro ‘DBG’ # 574| # 575| set_dirty(&bo_fake->bo); # 576|-> bo_fake->block = NULL; # 577| # 578| free_block(bufmgr_fake, block, 0); Error: GCC_ANALYZER_WARNING (CWE-476): [#def9] libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c: scope_hint: In function ‘drm_intel_bufmgr_fake_init’ libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c:1599:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bufmgr_fake’ libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_bufmgr_fake.c:50: included_from: Included from here. libdrm-2.4.123-build/libdrm-2.4.123/libdrm_lists.h:42:23: note: in definition of macro ‘DRMINITLISTHEAD’ # 1597| DRMINITLISTHEAD(&bufmgr_fake->lru); # 1598| # 1599|-> bufmgr_fake->low_offset = low_offset; # 1600| bufmgr_fake->virtual = low_virtual; # 1601| bufmgr_fake->size = size; Error: GCC_ANALYZER_WARNING (CWE-688): [#def10] libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_decode.c: scope_hint: In function ‘drm_intel_decode’ libdrm-2.4.123-build/libdrm-2.4.123/intel/intel_decode.c:3914:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘temp’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 3912| size = ctx->base_count * 4; # 3913| temp = malloc(size + 4096); # 3914|-> memcpy(temp, ctx->base_data, size); # 3915| memset((char *)temp + size, 0xd0, 4096); # 3916| ctx->data = temp; Error: GCC_ANALYZER_WARNING (CWE-688): [#def11] libdrm-2.4.123-build/libdrm-2.4.123/intel/test_decode.c: scope_hint: In function ‘compare_batch’ libdrm-2.4.123-build/libdrm-2.4.123/intel/test_decode.c:99:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ref_filename’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null # 97| # 98| ref_filename = malloc(strlen(batch_filename) + strlen(ref_suffix) + 1); # 99|-> sprintf(ref_filename, "%s%s", batch_filename, ref_suffix); # 100| # 101| /* Read the batch and reference. */ Error: GCC_ANALYZER_WARNING (CWE-476): [#def12] libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_chan_nv04’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c:38:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_chan_nv04’ # 36| { # 37| struct nouveau_drm *drm = nouveau_drm(obj); # 38|-> struct nv04_fifo *nv04 = obj->data; # 39| struct drm_nouveau_channel_alloc req = { # 40| .fb_ctxdma_handle = nv04->vram, Error: GCC_ANALYZER_WARNING (CWE-476): [#def13] libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_chan_nvc0’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c:63:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_chan_nvc0’ # 61| struct nouveau_drm *drm = nouveau_drm(obj); # 62| struct drm_nouveau_channel_alloc req = {}; # 63|-> struct nvc0_fifo *nvc0 = obj->data; # 64| int ret; # 65| Error: GCC_ANALYZER_WARNING (CWE-476): [#def14] libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_chan_nve0’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c:84:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_chan_nve0’ # 82| struct nouveau_drm *drm = nouveau_drm(obj); # 83| struct drm_nouveau_channel_alloc req = {}; # 84|-> struct nve0_fifo *nve0 = obj->data; # 85| int ret; # 86| Error: GCC_ANALYZER_WARNING (CWE-476): [#def15] libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_engobj’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c:110:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_engobj’ # 108| struct nouveau_drm *drm = nouveau_drm(obj); # 109| struct drm_nouveau_grobj_alloc req = { # 110|-> .channel = obj->parent->handle, # 111| .handle = obj->handle, # 112| .class = obj->oclass, Error: GCC_ANALYZER_WARNING (CWE-476): [#def16] libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_ntfy’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c:150:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_ntfy’ # 148| { # 149| struct nouveau_drm *drm = nouveau_drm(obj); # 150|-> struct nv04_notify *ntfy = obj->data; # 151| struct drm_nouveau_notifierobj_alloc req = { # 152| .channel = obj->parent->handle, Error: GCC_ANALYZER_WARNING (CWE-476): [#def17] libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_delete’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c:221:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/abi16.c: scope_hint: In function ‘abi16_delete’ # 219| { # 220| struct nouveau_drm *drm = nouveau_drm(obj); # 221|-> if (obj->oclass == NOUVEAU_FIFO_CHANNEL_CLASS) { # 222| struct drm_nouveau_channel_free req; # 223| req.channel = obj->handle; Error: GCC_ANALYZER_WARNING (CWE-401): [#def18] libdrm-2.4.123-build/libdrm-2.4.123/nouveau/bufctx.c: scope_hint: In function ‘nouveau_bufctx_new’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/bufctx.c:74:24: warning[-Wanalyzer-malloc-leak]: leak of ‘priv’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/bufctx.c:32: included_from: Included from here. libdrm-2.4.123-build/libdrm-2.4.123/libdrm_lists.h:42:23: note: in definition of macro ‘DRMINITLISTHEAD’ # 72| priv->base.client = client; # 73| priv->nr_bins = bins; # 74|-> *pbctx = &priv->base; # 75| return 0; # 76| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def19] libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c: scope_hint: In function ‘nouveau_object_ioctl’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:90:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:47: included_from: Included from here. libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c: scope_hint: In function ‘nouveau_object_ioctl’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:89:21: note: in expansion of macro ‘nvif_unpack’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:89:21: note: in expansion of macro ‘nvif_unpack’ # 88| # 89| if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, true))) { # 90|-> if (!obj->length) { # 91| if (obj != &drm->client) # 92| args->v0.object = (unsigned long)(void *)obj; Error: GCC_ANALYZER_WARNING (CWE-401): [#def20] libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c: scope_hint: In function ‘nouveau_device_new’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:395:24: warning[-Wanalyzer-malloc-leak]: leak of ‘nvdev’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c: scope_hint: In function ‘nouveau_device_new’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:394:13: note: in expansion of macro ‘nvif_unpack’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:394:13: note: in expansion of macro ‘nvif_unpack’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:394:13: note: in expansion of macro ‘nvif_unpack’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:394:13: note: in expansion of macro ‘nvif_unpack’ # 393| if (oclass != NV_DEVICE || # 394| nvif_unpack(ret, &data, &size, args->v0, 0, 0, false)) # 395|-> return ret; # 396| # 397| if (!(nvdev = calloc(1, sizeof(*nvdev)))) Error: GCC_ANALYZER_WARNING (CWE-476): [#def21] libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:402:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c: scope_hint: In function ‘nouveau_device_new’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:394:13: note: in expansion of macro ‘nvif_unpack’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:394:13: note: in expansion of macro ‘nvif_unpack’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:394:13: note: in expansion of macro ‘nvif_unpack’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:394:13: note: in expansion of macro ‘nvif_unpack’ # 400| dev->fd = -1; # 401| # 402|-> if (drm->nvif) { # 403| ret = nouveau_object_init(parent, 0, oclass, args, argc, # 404| &dev->object); Error: GCC_ANALYZER_WARNING (CWE-476): [#def22] libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c: scope_hint: In function ‘nouveau_bo_new’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:646:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘nvbo’ libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:36: included_from: Included from here. libdrm-2.4.123-build/libdrm-2.4.123/nouveau/nouveau.c:645:9: note: in expansion of macro ‘atomic_set’ # 644| return -ENOMEM; # 645| atomic_set(&nvbo->refcnt, 1); # 646|-> bo->device = dev; # 647| bo->flags = flags; # 648| bo->size = size; Error: GCC_ANALYZER_WARNING (CWE-476): [#def23] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c: scope_hint: In function ‘free_resources.part.0’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:583:56: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘*res.planes + (long unsigned int)i * 24’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:590:9: note: in expansion of macro ‘free_properties’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:656:9: note: in expansion of macro ‘get_resource’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:657:9: note: in expansion of macro ‘get_resource’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:658:9: note: in expansion of macro ‘get_resource’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:658:9: note: in expansion of macro ‘get_resource’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:659:9: note: in expansion of macro ‘get_resource’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:701:9: note: in expansion of macro ‘get_properties’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:702:9: note: in expansion of macro ‘get_properties’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:702:9: note: in expansion of macro ‘get_properties’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:702:9: note: in expansion of macro ‘get_properties’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:702:9: note: in expansion of macro ‘get_properties’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:702:9: note: in expansion of macro ‘get_properties’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c: scope_hint: In function ‘free_resources.part.0’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:590:9: note: in expansion of macro ‘free_properties’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:590:9: note: in expansion of macro ‘free_properties’ # 581| for (i = 0; i < (int)(_res)->count_##type##s; ++i) { \ # 582| unsigned int j; \ # 583|-> for (j = 0; j < res->type##s[i].props->count_props; ++j)\ # 584| drmModeFreeProperty(res->type##s[i].props_info[j]);\ # 585| free(res->type##s[i].props_info); \ Error: GCC_ANALYZER_WARNING (CWE-476): [#def24] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c: scope_hint: In function ‘pipe_find_crtc_and_mode’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:984:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘*pipe.crtc’ # 982| } else { # 983| pipe->crtc = pipe_find_crtc(dev, pipe); # 984|-> pipe->crtc_id = pipe->crtc->crtc->crtc_id; # 985| } # 986| Error: GCC_ANALYZER_WARNING (CWE-457): [#def25] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c: scope_hint: In function ‘set_property’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:1060:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*p.optional’ # 1058| # 1059| if (i == (int)props->count_props) { # 1060|-> if (!p->optional) # 1061| fprintf(stderr, "%s %i has no %s property\n", # 1062| obj_type, p->obj_id, p->name); Error: GCC_ANALYZER_WARNING (CWE-457): [#def26] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c: scope_hint: In function ‘set_plane’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:1348:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ovr’ # 1346| } # 1347| # 1348|-> ovr->crtc_id = p->crtc_id; # 1349| # 1350| return 0; Error: GCC_ANALYZER_WARNING (CWE-476): [#def27] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c: scope_hint: In function ‘writeback_config’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:1741:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 1739| for (i = 0; i < pipe->num_cons; i++) { # 1740| connector = get_connector_by_id(dev, pipe->con_ids[i]); # 1741|-> if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK) { # 1742| if (!pipe->mode) { # 1743| fprintf(stderr, "no mode for writeback\n"); Error: GCC_ANALYZER_WARNING (CWE-476): [#def28] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c: scope_hint: In function ‘dump_output_fb’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:1794:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 1792| for (i = 0; i < pipe->num_cons; i++) { # 1793| connector = get_connector_by_id(dev, pipe->con_ids[i]); # 1794|-> if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK) # 1795| bo_dump(pipe->out_bo, dump_path); # 1796| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def29] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c: scope_hint: In function ‘parse_connector’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:2027:29: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 2025| len = min(sizeof pipe->mode_str - 1, (unsigned int)(p - arg)); # 2026| strncpy(pipe->mode_str, arg, len); # 2027|-> pipe->mode_str[len] = '\0'; # 2028| # 2029| if (*p == '-') { Error: CPPCHECK_WARNING (CWE-401): [#def30] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:2248: error[memleakOnRealloc]: Common realloc mistake: 'plane_args' nulled but not freed upon failure # 2246| break; # 2247| case 'P': # 2248|-> plane_args = realloc(plane_args, # 2249| (plane_count + 1) * sizeof *plane_args); # 2250| if (plane_args == NULL) { Error: GCC_ANALYZER_WARNING (CWE-415): [#def31] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c: scope_hint: In function ‘main’ libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:2248:38: warning[-Wanalyzer-double-free]: double-‘free’ of ‘plane_args’ # 2246| break; # 2247| case 'P': # 2248|-> plane_args = realloc(plane_args, # 2249| (plane_count + 1) * sizeof *plane_args); # 2250| if (plane_args == NULL) { Error: CPPCHECK_WARNING (CWE-401): [#def32] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:2266: error[memleakOnRealloc]: Common realloc mistake: 'pipe_args' nulled but not freed upon failure # 2264| break; # 2265| case 's': # 2266|-> pipe_args = realloc(pipe_args, # 2267| (count + 1) * sizeof *pipe_args); # 2268| if (pipe_args == NULL) { Error: CPPCHECK_WARNING (CWE-401): [#def33] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:2289: error[memleakOnRealloc]: Common realloc mistake: 'prop_args' nulled but not freed upon failure # 2287| break; # 2288| case 'w': # 2289|-> prop_args = realloc(prop_args, # 2290| (prop_count + 1) * sizeof *prop_args); # 2291| if (prop_args == NULL) { Error: GCC_ANALYZER_WARNING (CWE-415): [#def34] libdrm-2.4.123-build/libdrm-2.4.123/tests/modetest/modetest.c:2289:37: warning[-Wanalyzer-double-free]: double-‘free’ of ‘prop_args’ # 2287| break; # 2288| case 'w': # 2289|-> prop_args = realloc(prop_args, # 2290| (prop_count + 1) * sizeof *prop_args); # 2291| if (prop_args == NULL) { Error: GCC_ANALYZER_WARNING (CWE-457): [#def35] libdrm-2.4.123-build/libdrm-2.4.123/tests/nouveau/threaded.c: scope_hint: In function ‘main’ libdrm-2.4.123-build/libdrm-2.4.123/tests/nouveau/threaded.c:126:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nvdev2’ # 124| return 1; # 125| # 126|-> err = nouveau_bo_new(nvdev2, NOUVEAU_BO_GART, 0, 4096, NULL, &bo); # 127| if (!err) # 128| err = nouveau_bo_set_prime(bo, &import_fd); Error: GCC_ANALYZER_WARNING (CWE-688): [#def36] libdrm-2.4.123-build/libdrm-2.4.123/tests/radeon/rbo.c: scope_hint: In function ‘rbo’ libdrm-2.4.123-build/libdrm-2.4.123/tests/radeon/rbo.c:88:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 86| return rbo_decref(bo); # 87| } # 88|-> memcpy(bo->data, ptr, size); # 89| rbo_unmap(bo); # 90| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def37] libdrm-2.4.123-build/libdrm-2.4.123/tests/util/pattern.c: scope_hint: In function ‘fsd_alloc’ libdrm-2.4.123-build/libdrm-2.4.123/tests/util/pattern.c:877:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fsd’ # 875| struct fsd *fsd = malloc(sizeof(*fsd) + n * sizeof(fsd->error[0])); # 876| # 877|-> fsd->width = width; # 878| fsd->x = 0; # 879| fsd->i = 0; Error: COMPILER_WARNING (CWE-252): [#def38] libdrm-2.4.123-build/libdrm-2.4.123/xf86drm.c: scope_hint: In function ‘drmGetFormatModifierNameFromNvidia’ libdrm-2.4.123-build/libdrm-2.4.123/xf86drm.c:362:9: warning[-Wunused-result]: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ # 362 | asprintf(&mod_nvidia, "BLOCK_LINEAR_2D,HEIGHT=%"PRIu64",KIND=%"PRIu64"," # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 363 | "GEN=%"PRIu64",SECTOR=%"PRIu64",COMPRESSION=%"PRIu64"", height, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 364 | kind, gen, sector, compression); # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 360| if ((modifier & 0x10) == 0x10) { # 361| char *mod_nvidia; # 362|-> asprintf(&mod_nvidia, "BLOCK_LINEAR_2D,HEIGHT=%"PRIu64",KIND=%"PRIu64"," # 363| "GEN=%"PRIu64",SECTOR=%"PRIu64",COMPRESSION=%"PRIu64"", height, # 364| kind, gen, sector, compression); Error: COMPILER_WARNING (CWE-252): [#def39] libdrm-2.4.123-build/libdrm-2.4.123/xf86drm.c: scope_hint: In function ‘drmGetFormatModifierNameFromAmlogic’ libdrm-2.4.123-build/libdrm-2.4.123/xf86drm.c:555:5: warning[-Wunused-result]: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ # 555 | asprintf(&mod_amlogic, "FBC,LAYOUT=%s,OPTIONS=%s", layout_str, opts_str); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 553| opts_str = "0"; # 554| # 555|-> asprintf(&mod_amlogic, "FBC,LAYOUT=%s,OPTIONS=%s", layout_str, opts_str); # 556| return mod_amlogic; # 557| } Error: COMPILER_WARNING (CWE-252): [#def40] libdrm-2.4.123-build/libdrm-2.4.123/xf86drm.c: scope_hint: In function ‘drmGetFormatModifierNameFromVivante’ libdrm-2.4.123-build/libdrm-2.4.123/xf86drm.c:619:5: warning[-Wunused-result]: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ # 619 | asprintf(&mod_vivante, "%s%s%s", color_tiling, tile_status, compression); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 617| } # 618| # 619|-> asprintf(&mod_vivante, "%s%s%s", color_tiling, tile_status, compression); # 620| return mod_vivante; # 621| } Error: GCC_ANALYZER_WARNING (CWE-688): [#def41] libdrm-2.4.123-build/libdrm-2.4.123/xf86drmMode.c: scope_hint: In function ‘drmModeAtomicCommit’ libdrm-2.4.123-build/libdrm-2.4.123/xf86drmMode.c:1543:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected libdrm-2.4.123-build/libdrm-2.4.123/xf86drmMode.c:1540:9: note: in expansion of macro ‘memclear’ libdrm-2.4.123-build/libdrm-2.4.123/xf86drmMode.c:39: included_from: Included from here. /usr/include/stdlib.h:970:13: note: argument 1 of ‘qsort’ must be non-null # 1541| # 1542| /* Sort the list by object ID, then by property ID. */ # 1543|-> qsort(sorted->items, sorted->cursor, sizeof(*sorted->items), # 1544| sort_req_list); # 1545|
analyzer-version-clippy | 1.82.0 |
analyzer-version-cppcheck | 2.16.0 |
analyzer-version-gcc | 14.2.1 |
analyzer-version-gcc-analyzer | 15.0.0 |
analyzer-version-shellcheck | 0.10.0 |
analyzer-version-unicontrol | 0.0.2 |
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
exit-code | 0 |
host | ip-172-16-1-21.us-west-2.compute.internal |
mock-config | fedora-rawhide-gcc-latest-x86_64 |
project-name | libdrm-2.4.123-1.fc42 |
store-results-to | /tmp/tmp5rd3egt3/libdrm-2.4.123-1.fc42.tar.xz |
time-created | 2024-11-13 01:25:27 |
time-finished | 2024-11-13 01:27:25 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp5rd3egt3/libdrm-2.4.123-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp5rd3egt3/libdrm-2.4.123-1.fc42.src.rpm' |
tool-version | csmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9 |