Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1250:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘error’
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1217:3: branch_false: following ‘false’ branch (when ‘mechanism’ is non-NULL)...
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1217:3: branch_false: ...to here
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1218:3: branch_true: following ‘true’ branch...
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1219:3: branch_true: following ‘true’ branch...
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1225:12: branch_true: ...to here
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1226:6: branch_false: following ‘false’ branch...
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1234:3: branch_false: ...to here
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1236:6: branch_false: following ‘false’ branch...
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1243:3: branch_false: ...to here
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1245:3: release_memory: ‘error’ is NULL
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1247:6: branch_true: following ‘true’ branch...
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1249:7: branch_true: ...to here
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1250:98: release_memory: ‘error’ is NULL
glib-2.88.0/gio/gdbusauthmechanismsha1.c:1250:32: danger: dereference of NULL ‘error’
# 1248|       {
# 1249|         g_free (m->priv->reject_reason);
# 1250|->       m->priv->reject_reason = g_strdup_printf ("Problems looking up entry in keyring: %s", error->message);
# 1251|         g_error_free (error);
# 1252|         m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED;

Error: COMPILER_WARNING (CWE-704): [#def2]
glib-2.88.0/gio/tests/gdbus-export.c: scope_hint: In function ‘dyna_cyber’
glib-2.88.0/gio/tests/gdbus-export.c:319:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  319 |   node_name = strrchr (object_path, '/') + 1;
#      |             ^
#  317|     guint n;
#  318|   
#  319|->   node_name = strrchr (object_path, '/') + 1;
#  320|   
#  321|     /* Add new node if it is not already known */

Error: COMPILER_WARNING (CWE-704): [#def3]
glib-2.88.0/gio/tests/gdbus-export.c:319:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  317|     guint n;
#  318|   
#  319|->   node_name = strrchr (object_path, '/') + 1;
#  320|   
#  321|     /* Add new node if it is not already known */

Error: COMPILER_WARNING (CWE-704): [#def4]
glib-2.88.0/gio/tests/gdbus-peer.c: scope_hint: In function ‘test_nonce_tcp’
glib-2.88.0/gio/tests/gdbus-peer.c:1764:5: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1764 |   s = strstr (address, "noncefile=");
#      |     ^
# 1762|     address = g_dbus_server_get_client_address (server);
# 1763|   
# 1764|->   s = strstr (address, "noncefile=");
# 1765|     g_assert (s != NULL);
# 1766|     s += sizeof "noncefile=" - 1;

Error: COMPILER_WARNING (CWE-704): [#def5]
glib-2.88.0/gio/tests/gdbus-peer.c:1764:5: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1762|     address = g_dbus_server_get_client_address (server);
# 1763|   
# 1764|->   s = strstr (address, "noncefile=");
# 1765|     g_assert (s != NULL);
# 1766|     s += sizeof "noncefile=" - 1;

Error: CPPCHECK_WARNING (CWE-758): [#def6]
glib-2.88.0/glib/tests/bitlock.c:92: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   90|   
#   91|         /* these bits must be set. */
#   92|->       g_assert_true (val & PARALLEL_LOCKMASK);
#   93|         g_assert_true (val & PARALLEL_SETMASK);
#   94|   

Error: CPPCHECK_WARNING (CWE-758): [#def7]
glib-2.88.0/glib/tests/bitlock.c:101: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   99|         g_assert_cmpint (val, ==, val2);
#  100|   
#  101|->       count_all = (val & ~(PARALLEL_LOCKMASK | PARALLEL_SETMASK));
#  102|   
#  103|         if ((g_random_int () % 5) == 0)

Error: CPPCHECK_WARNING (CWE-758): [#def8]
glib-2.88.0/glib/tests/bitlock.c:160: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  158|           {
#  159|             /* at last, the atomic must be unlocked. */
#  160|->           g_assert_true (!(val & PARALLEL_LOCKMASK));
#  161|           }
#  162|         val &= ~(PARALLEL_LOCKMASK | PARALLEL_TOGGLEMASK | PARALLEL_SETMASK);

Error: CPPCHECK_WARNING (CWE-758): [#def9]
glib-2.88.0/glib/tests/bitlock.c:162: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  160|             g_assert_true (!(val & PARALLEL_LOCKMASK));
#  161|           }
#  162|->       val &= ~(PARALLEL_LOCKMASK | PARALLEL_TOGGLEMASK | PARALLEL_SETMASK);
#  163|         g_assert_cmpint (val, ==, PARALLEL_MAX_COUNT_ALL);
#  164|       }

Error: GCC_ANALYZER_WARNING (CWE-835): [#def10]
glib-2.88.0/glib/tests/constructor-helper.c:158:5: warning[-Wanalyzer-infinite-loop]: infinite loop
#  156|   
#  157|     if (size > sizeof (buffer) - position)
#  158|->     g_error ("Not enough space in the buffer");
#  159|   
#  160|     memcpy_ (buffer + position, string, size);

Error: GCC_ANALYZER_WARNING (CWE-835): [#def11]
glib-2.88.0/glib/tests/constructor-helper.c:238:5: warning[-Wanalyzer-infinite-loop]: infinite loop
#  236|   {
#  237|     if (string_find_index_ (string) >= sizeof (buffer))
#  238|->     g_error ("String %s not present", string);
#  239|   }

Error: GCC_ANALYZER_WARNING (CWE-835): [#def12]
glib-2.88.0/glib/tests/mainloop.c:1084:11: warning[-Wanalyzer-infinite-loop]: infinite loop
glib-2.88.0/glib/tests/mainloop.c:1084:11: danger: infinite loop here
glib-2.88.0/glib/tests/mainloop.c:1084:10: branch_true: if it ever follows ‘true’ branch, it will always do so...
glib-2.88.0/glib/tests/mainloop.c:1084:10: branch_true: ...to here
# 1082|     loop = g_main_loop_new (NULL, FALSE);
# 1083|     thread = g_thread_new ("context thread", run_context, loop);
# 1084|->   while (!g_atomic_int_get (&ready_time_dispatched));
# 1085|   
# 1086|     /* Now let's see if it can wake up from sleeping. */

Error: GCC_ANALYZER_WARNING (CWE-835): [#def13]
glib-2.88.0/glib/tests/mainloop.c:1090:11: warning[-Wanalyzer-infinite-loop]: infinite loop
glib-2.88.0/glib/tests/mainloop.c:1090:11: danger: infinite loop here
glib-2.88.0/glib/tests/mainloop.c:1090:10: branch_true: if it ever follows ‘true’ branch, it will always do so...
glib-2.88.0/glib/tests/mainloop.c:1090:10: branch_true: ...to here
# 1088|     g_atomic_int_set (&ready_time_dispatched, FALSE);
# 1089|     g_source_set_ready_time (source, 0);
# 1090|->   while (!g_atomic_int_get (&ready_time_dispatched));
# 1091|   
# 1092|     /* kill the thread */

Error: COMPILER_WARNING: [#def14]
glib-2.88.0/glib/tests/testing.c:39:9: warning: ‘_POSIX_C_SOURCE’ redefined
#   39 | #define _POSIX_C_SOURCE 200809L  /* for F_DUPFD_CLOEXEC */
#      |         ^~~~~~~~~~~~~~~
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/limits.h:26: included_from: Included from here.
/usr/lib/gcc/x86_64-redhat-linux/16/include/limits.h:212: included_from: Included from here.
/usr/lib/gcc/x86_64-redhat-linux/16/include/syslimits.h:9: included_from: Included from here.
/usr/lib/gcc/x86_64-redhat-linux/16/include/limits.h:34: included_from: Included from here.
glib-2.88.0/redhat-linux-build/glib/glibconfig.h:11: included_from: Included from here.
glib-2.88.0/glib/gtypes.h:34: included_from: Included from here.
glib-2.88.0/glib/galloca.h:34: included_from: Included from here.
glib-2.88.0/glib/glib.h:32: included_from: Included from here.
glib-2.88.0/glib/tests/testing.c:33: included_from: Included from here.
/usr/include/features.h:319:10: note: this is the location of the previous definition
#  319 | # define _POSIX_C_SOURCE        202405L
#      |          ^~~~~~~~~~~~~~~
#   37|   
#   38|   #ifdef G_OS_UNIX
#   39|-> #define _POSIX_C_SOURCE 200809L  /* for F_DUPFD_CLOEXEC */
#   40|   #include <fcntl.h>
#   41|   #include <glib-unix.h>

Error: COMPILER_WARNING: [#def15]
glib-2.88.0/glib/tests/testing.c:39:9: warning[warning]: ‘_POSIX_C_SOURCE’ redefined
#   37|   
#   38|   #ifdef G_OS_UNIX
#   39|-> #define _POSIX_C_SOURCE 200809L  /* for F_DUPFD_CLOEXEC */
#   40|   #include <fcntl.h>
#   41|   #include <glib-unix.h>

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
glib-2.88.0/glib/tests/testing.c:495:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘__ret’
glib-2.88.0/glib/tests/testing.c:456:6: branch_false: following ‘false’ branch...
glib-2.88.0/glib/tests/testing.c:470:18: branch_false: ...to here
glib-2.88.0/glib/tests/testing.c:476:3: acquire_resource: opened here
glib-2.88.0/glib/tests/testing.c:476:3: branch_false: following ‘false’ branch (when ‘__ret >= 0’)...
glib-2.88.0/glib/tests/testing.c:479:3: branch_false: ...to here
glib-2.88.0/glib/tests/testing.c:487:3: branch_false: following ‘false’ branch (when ‘__ret >= 0’)...
glib-2.88.0/glib/tests/testing.c:489:3: branch_false: ...to here
glib-2.88.0/glib/tests/testing.c:495:1: danger: ‘__ret’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  493|     g_test_skip ("Testing stdin for subprocesses can only be done on Unix at the moment");
#  494|   #endif
#  495|-> }
#  496|   
#  497|   /* run a test with fixture setup and teardown */

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-75.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-nameglib2-2.89.3-1.fc45
diffbase-store-results-to/tmp/tmp7mtgz9sa/glib2-2.89.3-1.fc45.tar.xz
diffbase-time-created2026-08-03 14:48:52
diffbase-time-finished2026-08-03 15:01:09
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmp7mtgz9sa/glib2-2.89.3-1.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp7mtgz9sa/glib2-2.89.3-1.fc45.src.rpm'
diffbase-tool-versioncsmock-3.8.7.HEAD-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-75.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-nameglib2-2.88.0-1.fc44
store-results-to/tmp/tmp1tofktdt/glib2-2.88.0-1.fc44.tar.xz
time-created2026-08-03 14:34:22
time-finished2026-08-03 14:48:20
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmp1tofktdt/glib2-2.88.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp1tofktdt/glib2-2.88.0-1.fc44.src.rpm'
tool-versioncsmock-3.8.7.HEAD-1.el9