libffi-3.4.6-1.fc41

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
libffi-3.4.6-build/libffi-3.4.6/src/closures.c:37: included_from: Included from here.
libffi-3.4.6-build/libffi-3.4.6/src/closures.c: scope_hint: In function 'ffi_closure_alloc'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:1960:56: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libffi-3.4.6-build/libffi-3.4.6/x86_64-redhat-linux-gnu/include/ffi.h:506:36: note: in definition of macro 'FFI_FN'
libffi-3.4.6-build/libffi-3.4.6/src/closures.c:1004:23: note: in expansion of macro 'add_segment_exec_offset'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:4157:8: note: in expansion of macro 'PREACTION'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:4258:5: note: in expansion of macro 'POSTACTION'
libffi-3.4.6-build/libffi-3.4.6/x86_64-redhat-linux-gnu/include/ffi.h:506:36: note: in definition of macro 'FFI_FN'
libffi-3.4.6-build/libffi-3.4.6/src/closures.c:1004:23: note: in expansion of macro 'add_segment_exec_offset'
# 1958|     (mmap_exec_offset((b),(s)) == (S)->exec_offset)
# 1959|   
# 1960|-> # define add_segment_exec_offset(p,S) ((char*)(p) + (S)->exec_offset)
# 1961|   # define sub_segment_exec_offset(p,S) ((char*)(p) - (S)->exec_offset)
# 1962|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
libffi-3.4.6-build/libffi-3.4.6/src/closures.c:572: included_from: Included from here.
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c: scope_hint: In function 'add_segment'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:3380:24: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:1320:30: note: in expansion of macro 'mmap'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:3525:26: note: in expansion of macro 'CALL_MMAP'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:3558:10: note: in expansion of macro 'is_initialized'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:1958:4: note: in expansion of macro 'mmap_exec_offset'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:3594:13: note: in expansion of macro 'check_segment_merge'
# 3378|     char* old_top = (char*)m->top;
# 3379|     msegmentptr oldsp = segment_holding(m, old_top);
# 3380|->   char* old_end = oldsp->base + oldsp->size;
# 3381|     size_t ssize = pad_request(sizeof(struct malloc_segment));
# 3382|     char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def3]
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c: scope_hint: In function 'sys_trim'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:3680:17: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:4283:10: note: in expansion of macro 'PREACTION'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:2462:38: note: in definition of macro 'RTCHECK'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:4285:19: note: in expansion of macro 'ok_address'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:4317:16: note: in expansion of macro 'cinuse'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c:4326:19: note: in expansion of macro 'should_trim'
libffi-3.4.6-build/libffi-3.4.6/src/dlmalloc.c: scope_hint: In function 'sys_trim'
# 3678|           if (is_mmapped_segment(sp)) {
# 3679|             if (HAVE_MMAP &&
# 3680|->               sp->size >= extra &&
# 3681|                 !has_segment_link(m, sp)) { /* can't shrink if pinned */
# 3682|               size_t newsize = sp->size - extra;

Error: COMPILER_WARNING (CWE-477): [#def4]
libffi-3.4.6-build/libffi-3.4.6/src/java_raw_api.c: scope_hint: In function 'ffi_java_raw_call'
libffi-3.4.6-build/libffi-3.4.6/src/java_raw_api.c:317:3: warning[-Wdeprecated-declarations]: 'ffi_java_raw_to_ptrarray' is deprecated
#  317 |   ffi_java_raw_to_ptrarray (cif, raw, avalue);
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~
libffi-3.4.6-build/libffi-3.4.6/src/java_raw_api.c:76:1: note: declared here
#   76 | ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args)
#      | ^~~~~~~~~~~~~~~~~~~~~~~~
#  315|   {
#  316|     void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
#  317|->   ffi_java_raw_to_ptrarray (cif, raw, avalue);
#  318|     ffi_call (cif, fn, rvalue, avalue);
#  319|     ffi_java_rvalue_to_raw (cif, rvalue);

Error: COMPILER_WARNING (CWE-477): [#def5]
libffi-3.4.6-build/libffi-3.4.6/src/java_raw_api.c: scope_hint: In function 'ffi_java_translate_args'
libffi-3.4.6-build/libffi-3.4.6/src/java_raw_api.c:328:3: warning[-Wdeprecated-declarations]: 'ffi_java_raw_size' is deprecated
#  328 |   ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
#      |   ^~~~~~~~~~~~
libffi-3.4.6-build/libffi-3.4.6/src/java_raw_api.c:45:1: note: declared here
#   45 | ffi_java_raw_size (ffi_cif *cif)
#      | ^~~~~~~~~~~~~~~~~
#  326|   		    void **avalue, void *user_data)
#  327|   {
#  328|->   ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
#  329|     ffi_raw_closure *cl = (ffi_raw_closure*)user_data;
#  330|   

Error: COMPILER_WARNING (CWE-477): [#def6]
libffi-3.4.6-build/libffi-3.4.6/src/java_raw_api.c:331:3: warning[-Wdeprecated-declarations]: 'ffi_java_ptrarray_to_raw' is deprecated
#  331 |   ffi_java_ptrarray_to_raw (cif, avalue, raw);
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~
libffi-3.4.6-build/libffi-3.4.6/src/java_raw_api.c:157:1: note: declared here
#  157 | ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw)
#      | ^~~~~~~~~~~~~~~~~~~~~~~~
#  329|     ffi_raw_closure *cl = (ffi_raw_closure*)user_data;
#  330|   
#  331|->   ffi_java_ptrarray_to_raw (cif, avalue, raw);
#  332|     (*cl->fun) (cif, rvalue, (ffi_raw*)raw, cl->user_data);
#  333|     ffi_java_raw_to_rvalue (cif, rvalue);

Error: COMPILER_WARNING (CWE-477): [#def7]
libffi-3.4.6-build/libffi-3.4.6/src/java_raw_api.c: scope_hint: In function 'ffi_prep_java_raw_closure'
libffi-3.4.6-build/libffi-3.4.6/src/java_raw_api.c:369:3: warning[-Wdeprecated-declarations]: 'ffi_prep_java_raw_closure_loc' is deprecated
#  369 |   return ffi_prep_java_raw_closure_loc (cl, cif, fun, user_data, cl);
#      |   ^~~~~~
libffi-3.4.6-build/libffi-3.4.6/src/java_raw_api.c:337:1: note: declared here
#  337 | ffi_prep_java_raw_closure_loc (ffi_java_raw_closure* cl,
#      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  367|   			   void *user_data)
#  368|   {
#  369|->   return ffi_prep_java_raw_closure_loc (cl, cif, fun, user_data, cl);
#  370|   }
#  371|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
libffi-3.4.6-build/libffi-3.4.6/src/tramp.c: scope_hint: In function 'tramp_table_alloc'
libffi-3.4.6-build/libffi-3.4.6/src/tramp.c:483:17: warning[-Wanalyzer-malloc-leak]: leak of 'table'
#  481|     code = table->code_table;
#  482|     parm = table->parm_table;
#  483|->   for (i = 0; i < tramp_globals.ntramp; i++)
#  484|       {
#  485|         tramp = &tramp_array[i];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
libffi-3.4.6-build/libffi-3.4.6/src/tramp.c:483:17: warning[-Wanalyzer-malloc-leak]: leak of 'tramp_array'
#  481|     code = table->code_table;
#  482|     parm = table->parm_table;
#  483|->   for (i = 0; i < tramp_globals.ntramp; i++)
#  484|       {
#  485|         tramp = &tramp_array[i];

Error: CLANG_WARNING: [#def10]
libffi-3.4.6-build/libffi-3.4.6/src/tramp.c:495:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'table'
#  493|       }
#  494|     /* Success */
#  495|->   return 1;
#  496|   
#  497|   /* Failure */

Error: GCC_ANALYZER_WARNING (CWE-416): [#def11]
libffi-3.4.6-build/libffi-3.4.6/src/tramp.c:555:22: warning[-Wanalyzer-use-after-free]: use after 'free' of 'table'
#  553|     struct tramp_table *table = tramp->table;
#  554|   
#  555|->   tramp->next = table->free;
#  556|     tramp->prev = NULL;
#  557|     if (table->free != NULL)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def12]
libffi-3.4.6-build/libffi-3.4.6/src/tramp.c: scope_hint: In function 'tramp_add'
libffi-3.4.6-build/libffi-3.4.6/src/tramp.c:555:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*table.free'
#  553|     struct tramp_table *table = tramp->table;
#  554|   
#  555|->   tramp->next = table->free;
#  556|     tramp->prev = NULL;
#  557|     if (table->free != NULL)

Error: CPPCHECK_WARNING: [#def13]
libffi-3.4.6-build/libffi-3.4.6/src/x86/ffi64.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def14]
libffi-3.4.6-build/libffi-3.4.6/src/x86/ffiw64.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-188.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibffi-3.4.6-1.fc41
store-results-to/tmp/tmpg5c3ugpf/libffi-3.4.6-1.fc41.tar.xz
time-created2024-07-03 14:51:05
time-finished2024-07-03 14:52:01
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpg5c3ugpf/libffi-3.4.6-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpg5c3ugpf/libffi-3.4.6-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9