pygobject3-3.48.2-1.fc41
List of Defects
Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
pygobject-3.48.2/gi/gimodule.c: scope_hint: In function ‘add_signals’
pygobject-3.48.2/gi/gimodule.c:845:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘c’
/usr/include/python3.12/Python.h:44: included_from: Included from here.
pygobject-3.48.2/gi/gimodule.c:24: included_from: Included from here.
/usr/include/python3.12/unicodeobject.h:115:5: note: in expansion of macro ‘PyType_FastSubclass’
pygobject-3.48.2/gi/gimodule.c:831:14: note: in expansion of macro ‘PyUnicode_Check’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: 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.
pygobject-3.48.2/gi/gimodule.c:25: included_from: Included from here.
pygobject-3.48.2/gi/gimodule.c:844:33: note: in expansion of macro ‘g_strdup’
pygobject-3.48.2/gi/gimodule.c: scope_hint: In function ‘add_signals’
# 843| /* canonicalize signal name, replacing '-' with '_' */
# 844| signal_name_canon = g_strdup(signal_name);
# 845|-> for (c = signal_name_canon; *c; ++c)
# 846| if (*c == '-')
# 847| *c = '_';
Error: CLANG_WARNING: [#def2]
pygobject-3.48.2/gi/gimodule.c:1613:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'enum_value'
# 1611| }
# 1612|
# 1613|-> g_free (full_name);
# 1614| return pyg_enum_add (NULL, type_name, NULL, g_type);
# 1615| }
Error: CLANG_WARNING: [#def3]
pygobject-3.48.2/gi/gimodule.c:1613:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'g_enum_values'
# 1611| }
# 1612|
# 1613|-> g_free (full_name);
# 1614| return pyg_enum_add (NULL, type_name, NULL, g_type);
# 1615| }
Error: CLANG_WARNING: [#def4]
pygobject-3.48.2/gi/gimodule.c:1732:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'flags_value'
# 1730| }
# 1731|
# 1732|-> g_free (full_name);
# 1733| return pyg_flags_add (NULL, type_name, NULL, g_type);
# 1734| }
Error: CLANG_WARNING: [#def5]
pygobject-3.48.2/gi/gimodule.c:1732:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'g_flags_values'
# 1730| }
# 1731|
# 1732|-> g_free (full_name);
# 1733| return pyg_flags_add (NULL, type_name, NULL, g_type);
# 1734| }
Error: CPPCHECK_WARNING (CWE-758): [#def6]
pygobject-3.48.2/gi/pygi-argument.c:123: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 121| switch (type_tag) {
# 122| case GI_TYPE_TAG_INT8:
# 123|-> arg->v_int8 = (gint8)GPOINTER_TO_INT (arg->v_pointer);
# 124| break;
# 125| case GI_TYPE_TAG_INT16:
Error: CPPCHECK_WARNING (CWE-758): [#def7]
pygobject-3.48.2/gi/pygi-argument.c:126: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 124| break;
# 125| case GI_TYPE_TAG_INT16:
# 126|-> arg->v_int16 = (gint16)GPOINTER_TO_INT (arg->v_pointer);
# 127| break;
# 128| case GI_TYPE_TAG_INT32:
Error: CPPCHECK_WARNING (CWE-758): [#def8]
pygobject-3.48.2/gi/pygi-argument.c:129: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 127| break;
# 128| case GI_TYPE_TAG_INT32:
# 129|-> arg->v_int32 = (gint32)GPOINTER_TO_INT (arg->v_pointer);
# 130| break;
# 131| case GI_TYPE_TAG_UINT8:
Error: CPPCHECK_WARNING (CWE-758): [#def9]
pygobject-3.48.2/gi/pygi-argument.c:132: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 130| break;
# 131| case GI_TYPE_TAG_UINT8:
# 132|-> arg->v_uint8 = (guint8)GPOINTER_TO_UINT (arg->v_pointer);
# 133| break;
# 134| case GI_TYPE_TAG_UINT16:
Error: CPPCHECK_WARNING (CWE-758): [#def10]
pygobject-3.48.2/gi/pygi-argument.c:135: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 133| break;
# 134| case GI_TYPE_TAG_UINT16:
# 135|-> arg->v_uint16 = (guint16)GPOINTER_TO_UINT (arg->v_pointer);
# 136| break;
# 137| case GI_TYPE_TAG_UINT32:
Error: CPPCHECK_WARNING (CWE-758): [#def11]
pygobject-3.48.2/gi/pygi-argument.c:138: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 136| break;
# 137| case GI_TYPE_TAG_UINT32:
# 138|-> arg->v_uint32 = (guint32)GPOINTER_TO_UINT (arg->v_pointer);
# 139| break;
# 140| case GI_TYPE_TAG_GTYPE:
Error: CPPCHECK_WARNING (CWE-758): [#def12]
pygobject-3.48.2/gi/pygi-argument.c:141: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
# 139| break;
# 140| case GI_TYPE_TAG_GTYPE:
# 141|-> arg->v_size = GPOINTER_TO_SIZE (arg->v_pointer);
# 142| break;
# 143| case GI_TYPE_TAG_UTF8:
Error: CPPCHECK_WARNING (CWE-562): [#def13]
pygobject-3.48.2/gi/pygi-cache.c:862: error[returnDanglingLifetime]: Returning pointer to local variable 'state' that will be invalid when returning.
# 860| PyGIInvokeState state = { 0, };
# 861|
# 862|-> return function_cache->invoke (function_cache, &state,
# 863| py_args, py_kwargs);
# 864| }
Error: CPPCHECK_WARNING (CWE-562): [#def14]
pygobject-3.48.2/gi/pygi-cache.c:899: error[returnDanglingLifetime]: Returning pointer to local variable 'state' that will be invalid when returning.
# 897| state.user_data = user_data;
# 898|
# 899|-> return function_cache->invoke (function_cache, &state,
# 900| py_args, py_kwargs);
# 901| }
Error: CLANG_WARNING: [#def15]
pygobject-3.48.2/gi/pygi-cache.c:25: included_from: Included from here.
pygobject-3.48.2/gi/pygi-info.h:26: included_from: Included from here.
pygobject-3.48.2/gi/pygi-cache.h:321:12: warning[core.NullDereference]: Access to field 'len' results in a dereference of a null pointer (loaded from field 'args_cache')
# 319| inline static guint
# 320| _pygi_callable_cache_args_len (PyGICallableCache *cache) {
# 321|-> return ((cache)->args_cache)->len;
# 322| }
# 323|
Error: CLANG_WARNING: [#def16]
pygobject-3.48.2/gi/pygi-array.c:24: included_from: Included from here.
pygobject-3.48.2/gi/pygi-array.h:24: included_from: Included from here.
pygobject-3.48.2/gi/pygi-cache.h:326:29: warning[core.NullDereference]: Access to field 'args_cache' results in a dereference of a null pointer (loaded from variable 'cache')
# 324| inline static PyGIArgCache *
# 325| _pygi_callable_cache_get_arg (PyGICallableCache *cache, guint index) {
# 326|-> return (PyGIArgCache *) g_ptr_array_index (cache->args_cache, index);
# 327| }
# 328|
Error: CLANG_WARNING: [#def17]
pygobject-3.48.2/gi/pygi-closure.c:20: included_from: Included from here.
pygobject-3.48.2/gi/pygi-closure.h:25: included_from: Included from here.
pygobject-3.48.2/gi/pygi-cache.h:331:5: warning[core.NullDereference]: Access to field 'args_cache' results in a dereference of a null pointer (loaded from variable 'cache')
# 329| inline static void
# 330| _pygi_callable_cache_set_arg (PyGICallableCache *cache, guint index, PyGIArgCache *arg_cache) {
# 331|-> cache->args_cache->pdata[index] = arg_cache;
# 332| }
# 333|
Error: CPPCHECK_WARNING (CWE-562): [#def18]
pygobject-3.48.2/gi/pygi-closure.c:414: error[invalidLifetime]: Using pointer to local variable 'cleanup_data' that is out of scope.
# 412| }
# 413|
# 414|-> PyTuple_SET_ITEM (state->py_in_args, n_in_args, value);
# 415| n_in_args++;
# 416| }
Error: GCC_ANALYZER_WARNING (CWE-476): [#def19]
pygobject-3.48.2/gi/pygi-fundamental.c: scope_hint: In function ‘pygi_fundamental_ref’
pygobject-3.48.2/gi/pygi-fundamental.c:202:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘self’
/usr/include/glib-2.0/gobject/gobject.h:26: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:31: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/gobject-introspection-1.0/girepository.h:26: included_from: Included from here.
pygobject-3.48.2/gi/pygi-fundamental.c:27: included_from: Included from here.
/usr/include/glib-2.0/gobject/gtype.h:657:82: note: in definition of macro ‘G_TYPE_FROM_CLASS’
pygobject-3.48.2/gi/pygi-fundamental.c:155:13: note: in expansion of macro ‘G_TYPE_FROM_INSTANCE’
# 200| pygi_fundamental_ref (PyGIFundamental *self)
# 201| {
# 202|-> if (self->ref_func && self->instance)
# 203| self->ref_func (self->instance);
# 204| }
Error: CLANG_WARNING: [#def20]
pygobject-3.48.2/gi/pygi-invoke.c:589:13: warning[core.NullDereference]: Access to field 'is_skipped' results in a dereference of a null pointer (loaded from field 'return_cache')
# 587|
# 588| if (n_out_args == 0) {
# 589|-> if (cache->return_cache->is_skipped && state->error == NULL) {
# 590| /* we skip the return value and have no (out) arguments to return,
# 591| * so py_return should be NULL. But we must not return NULL,
Error: GCC_ANALYZER_WARNING (CWE-476): [#def21]
pygobject-3.48.2/gi/pygi-invoke.c: scope_hint: In function ‘_invoke_marshal_out_args’
pygobject-3.48.2/gi/pygi-invoke.c:589:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘*(PyGICallableCache *)function_cache.return_cache’
# 587|
# 588| if (n_out_args == 0) {
# 589|-> if (cache->return_cache->is_skipped && state->error == NULL) {
# 590| /* we skip the return value and have no (out) arguments to return,
# 591| * so py_return should be NULL. But we must not return NULL,
Error: CPPCHECK_WARNING (CWE-562): [#def22]
pygobject-3.48.2/gi/pygi-invoke.c:594: error[invalidLifetime]: Using pointer to local variable 'cleanup_data' that is out of scope.
# 592| * otherwise Python will expect an exception.
# 593| */
# 594|-> g_assert (py_return == NULL);
# 595| Py_INCREF(Py_None);
# 596| py_return = Py_None;
Error: CPPCHECK_WARNING (CWE-562): [#def23]
pygobject-3.48.2/gi/pygi-invoke.c:662: error[returnDanglingLifetime]: Returning pointer to local variable 'cleanup_data' that will be invalid when returning.
# 660| }
# 661| }
# 662|-> return py_out;
# 663| }
# 664|
Error: CPPCHECK_WARNING (CWE-457): [#def24]
pygobject-3.48.2/gi/pygi-invoke.c:759: error[legacyUninitvar]: Uninitialized variable: function_cache
# 757| }
# 758|
# 759|-> self->cache = (PyGICallableCache *)function_cache;
# 760| if (self->cache == NULL)
# 761| return NULL;
Error: CLANG_WARNING: [#def25]
pygobject-3.48.2/gi/pygi-object.c:107:36: warning[core.NullDereference]: Access to field 'ref_count' results in a dereference of a null pointer (loaded from variable 'gobj')
# 105| */
# 106| gobj = arg->v_pointer;
# 107|-> if (Py_REFCNT (py_arg) == 1 && gobj->ref_count == 1) {
# 108| /* If both object ref counts are only 1 at this point (the reference held
# 109| * in a return tuple), we assume the GObject will be free'd before reaching
Error: GCC_ANALYZER_WARNING (CWE-476): [#def26]
pygobject-3.48.2/gi/pygi-object.c: scope_hint: In function ‘pygi_arg_gobject_out_arg_from_py’
pygobject-3.48.2/gi/pygi-object.c:107:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘gobj’
# 105| */
# 106| gobj = arg->v_pointer;
# 107|-> if (Py_REFCNT (py_arg) == 1 && gobj->ref_count == 1) {
# 108| /* If both object ref counts are only 1 at this point (the reference held
# 109| * in a return tuple), we assume the GObject will be free'd before reaching
Error: CLANG_WARNING: [#def27]
pygobject-3.48.2/gi/pygi-property.c:374:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'strings'
# 372| strings[arg_items->len] = NULL;
# 373| g_value_take_boxed (&value, strings);
# 374|-> g_array_free (arg_items, TRUE);
# 375| break;
# 376| }
Error: CLANG_WARNING: [#def28]
pygobject-3.48.2/gi/pygi-type.c:614:6: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 612| else {
# 613| PyErr_SetString(PyExc_TypeError, "could not convert string to enum because there is no GType associated to look up the value");
# 614|-> res = -1;
# 615| }
# 616| info = g_enum_get_value_by_name(eclass, str);
Error: CLANG_WARNING: [#def29]
pygobject-3.48.2/gi/pygi-type.c:671:6: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 669| else {
# 670| PyErr_SetString(PyExc_TypeError, "could not convert string to flag because there is no GType associated to look up the value");
# 671|-> res = -1;
# 672| }
# 673| info = g_flags_get_value_by_name(fclass, str);
Error: CLANG_WARNING: [#def30]
pygobject-3.48.2/gi/pygi-type.c:1341:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'argv'
# 1339| argv[i] = NULL;
# 1340| g_value_take_boxed (value, argv);
# 1341|-> return 0;
# 1342|
# 1343| error:
Error: CLANG_WARNING: [#def31]
pygobject-3.48.2/gi/pygobject-object.c:123:11: warning[deadcode.DeadStores]: Although the value stored to 'closures' is used in the enclosing expression, the value is never actually read from 'closures'
# 121| }
# 122|
# 123|-> tmp = closures = data->closures;
# 124| #ifndef NDEBUG
# 125| data->closures = NULL;
Error: CLANG_WARNING: [#def32]
pygobject-3.48.2/redhat-linux-build/tmp-introspect60e2nuaz/GIMarshallingTests-1.0.c:799:27: warning[core.NullDereference]: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'error')
Error: CLANG_WARNING: [#def33]
pygobject-3.48.2/redhat-linux-build/tmp-introspectku27ysk6/Regress-1.0.c:799:27: warning[core.NullDereference]: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'error')
Error: CLANG_WARNING: [#def34]
pygobject-3.48.2/tests/testhelpermodule.c:758:8: warning[deadcode.DeadStores]: Although the value stored to 'm' is used in the enclosing expression, the value is never actually read from 'm'
# 756| d = PyModule_GetDict(module);
# 757|
# 758|-> if ((m = PyImport_ImportModule("gi.repository.GObject")) == NULL) {
# 759| PyErr_SetString(PyExc_ImportError,
# 760| "could not import gobject");
Scan Properties
analyzer-version-clang | 18.1.3 |
analyzer-version-cppcheck | 2.13.0 |
analyzer-version-gcc | 14.0.1 |
analyzer-version-gcc-analyzer | 14.0.1 |
analyzer-version-shellcheck | 0.10.0 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-75.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | pygobject3-3.48.2-1.fc41 |
store-results-to | /tmp/tmp9c_p9w4n/pygobject3-3.48.2-1.fc41.tar.xz |
time-created | 2024-04-22 11:20:40 |
time-finished | 2024-04-22 11:22:08 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp9c_p9w4n/pygobject3-3.48.2-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp9c_p9w4n/pygobject3-3.48.2-1.fc41.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |