Newly introduced defects

List of Defects

Error: CLANG_WARNING: [#def1]
libxkbcommon-1.7.0/tools/compile-compose.c:33: included_from: Included from here.
libxkbcommon-1.7.0/src/compose/dump.h:48:16: warning[unix.MallocSizeof]: Result of 'calloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'char *'
#   46|       const size_t length = strlen(from);
#   47|       /* Longest escape is converting ASCII character to "\xNN" */
#   48|->     char* to = calloc(4 * length + 1, sizeof(to));
#   49|       if (!to)
#   50|           return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
libxkbcommon-1.7.0/tools/compile-compose.c:33: included_from: Included from here.
libxkbcommon-1.7.0/src/compose/dump.h: scope_hint: In function ‘escape_utf8_string_literal’
libxkbcommon-1.7.0/src/compose/dump.h:92:12: warning[-Wanalyzer-malloc-leak]: leak of ‘to’
#   90|       }
#   91|       to[t++] = '\0';
#   92|->     return realloc(to, t);
#   93|   }
#   94|   

Error: CLANG_WARNING: [#def3]
libxkbcommon-1.7.0/test/compose.c:912:34: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
#  910|                   assert(c <= sizeof(buf) - 1);
#  911|               }
#  912|->             assert_printf(buf[c] == '\0', "NULL-terminated string\n");
#  913|               assert_printf(strlen(buf) == c, "Contains no NULL char\n");
#  914|               assert_printf(is_valid_utf8(buf, c),

Error: CLANG_WARNING: [#def4]
libxkbcommon-1.7.0/test/compose.c:920:27: warning[unix.Malloc]: Potential memory leak
#  918|               if (!escaped)
#  919|                   break;
#  920|->             assert_printf(is_valid_utf8(escaped, strlen(escaped)),
#  921|                             "Invalid input UTF-8 string: %s\n", escaped);
#  922|               char *string_literal = asprintf_safe("\"%s\"", escaped);

Error: CLANG_WARNING: [#def5]
libxkbcommon-1.7.0/test/keysym.c:394:5: warning[deadcode.DeadStores]: Value stored to 'iter' is never read
#  392|   #endif
#  393|       }
#  394|->     iter = xkb_keysym_iterator_unref(iter);
#  395|       assert(ks_prev == XKB_KEYSYM_MAX_ASSIGNED);
#  396|       assert(count == XKB_KEYSYM_UNICODE_MAX - XKB_KEYSYM_UNICODE_MIN + 1 + count_non_unicode);

Error: CLANG_WARNING: [#def6]
libxkbcommon-1.7.0/tools/compile-compose.c:74:13: warning[unix.Malloc]: Potential memory leak
#   72|           char *escaped = escape_utf8_string_literal(utf8);
#   73|           if (!escaped) {
#   74|->             fprintf(stderr, "ERROR: Cannot escape the string: allocation error\n");
#   75|               return false;
#   76|           } else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def7]
libxkbcommon-1.7.0/tools/interactive-wayland.c: scope_hint: In function ‘seat_create’
libxkbcommon-1.7.0/tools/interactive-wayland.c:582:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘seat’
#  580|       struct interactive_seat *seat = calloc(1, sizeof(*seat));
#  581|   
#  582|->     seat->global_name = name;
#  583|       seat->inter = inter;
#  584|       seat->wl_seat = wl_registry_bind(registry, name, &wl_seat_interface,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def8]
libxkbcommon-1.7.0/tools/interactive-wayland.c: scope_hint: In function ‘main’
libxkbcommon-1.7.0/tools/interactive-wayland.c:820:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ret’
#  818|       xkb_compose_table_unref(compose_table);
#  819|   err_out:
#  820|->     exit(ret >= 0 ? EXIT_SUCCESS : EXIT_FAILURE);
#  821|   }

Error: COMPILER_WARNING (CWE-457): [#def9]
libxkbcommon-1.7.0/tools/interactive-wayland.c: scope_hint: In function ‘main’
libxkbcommon-1.7.0/tools/interactive-wayland.c:820:5: warning[-Wmaybe-uninitialized]: ‘ret’ may be used uninitialized
#  820 |     exit(ret >= 0 ? EXIT_SUCCESS : EXIT_FAILURE);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libxkbcommon-1.7.0/tools/interactive-wayland.c:716:9: note: ‘ret’ was declared here
#  716 |     int ret;
#      |         ^~~
#  818|       xkb_compose_table_unref(compose_table);
#  819|   err_out:
#  820|->     exit(ret >= 0 ? EXIT_SUCCESS : EXIT_FAILURE);
#  821|   }

Error: CLANG_WARNING: [#def10]
libxkbcommon-1.7.0/tools/interactive-wayland.c:820:14: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>=' is a garbage value
#  818|       xkb_compose_table_unref(compose_table);
#  819|   err_out:
#  820|->     exit(ret >= 0 ? EXIT_SUCCESS : EXIT_FAILURE);
#  821|   }

Error: CLANG_WARNING: [#def11]
libxkbcommon-1.7.0/tools/interactive-x11.c:196:5: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  194|   deinit_kbd(struct keyboard *kbd)
#  195|   {
#  196|->     xkb_state_unref(kbd->state);
#  197|       xkb_compose_state_unref(kbd->compose_state);
#  198|       xkb_keymap_unref(kbd->keymap);

Scan Properties

analyzer-version-clang18.1.3
analyzer-version-cppcheck2.13.0
analyzer-version-gcc14.0.1
analyzer-version-gcc-analyzer14.0.1
analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-clang18.1.3
diffbase-analyzer-version-cppcheck2.13.0
diffbase-analyzer-version-gcc14.0.1
diffbase-analyzer-version-gcc-analyzer14.0.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-43.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-namelibxkbcommon-1.6.0-2.fc40
diffbase-store-results-to/tmp/tmp7x6c6z0m/libxkbcommon-1.6.0-2.fc40.tar.xz
diffbase-time-created2024-04-22 11:04:00
diffbase-time-finished2024-04-22 11:08:35
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp7x6c6z0m/libxkbcommon-1.6.0-2.fc40.tar.xz' '--gcc-analyze' '/tmp/tmp7x6c6z0m/libxkbcommon-1.6.0-2.fc40.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-43.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibxkbcommon-1.7.0-1.fc41
store-results-to/tmp/tmpo4cfd8cm/libxkbcommon-1.7.0-1.fc41.tar.xz
time-created2024-04-22 11:09:09
time-finished2024-04-22 11:15:43
titleNewly introduced defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpo4cfd8cm/libxkbcommon-1.7.0-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpo4cfd8cm/libxkbcommon-1.7.0-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9