Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
lv2-1.18.8-build/lv2-1.18.8/include/lv2/atom/util.h:59:43: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘handle’
lv2-1.18.8-build/lv2-1.18.8/plugins/eg-sampler.lv2/sampler.c: scope_hint: In function ‘atom_sink’
lv2-1.18.8-build/lv2-1.18.8/plugins/eg-sampler.lv2/sampler.c:28: included_from: Included from here.
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘atom_sink’
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘atom_sink’
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘atom_sink’
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘atom_sink’
lv2-1.18.8-build/lv2-1.18.8/plugins/eg-sampler.lv2/sampler.c:30: included_from: Included from here.
lv2-1.18.8-build/lv2-1.18.8/plugins/eg-sampler.lv2/sampler.c:22: included_from: Included from here.
#   57|   lv2_atom_total_size(const LV2_Atom* atom)
#   58|   {
#   59|->   return (uint32_t)sizeof(LV2_Atom) + atom->size;
#   60|   }
#   61|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
lv2-1.18.8-build/lv2-1.18.8/plugins/eg-sampler.lv2/sampler.c: scope_hint: In function ‘load_sample’
lv2-1.18.8-build/lv2-1.18.8/plugins/eg-sampler.lv2/sampler.c:135:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sample’
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘load_sample’
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘load_sample’
#  133|     float*         data     = NULL;
#  134|     bool           error    = true;
#  135|->   if (!sndfile || !info->frames) {
#  136|       lv2_log_error(logger, "Failed to open %s\n", path);
#  137|     } else if (!(data = (float*)malloc(sizeof(float) * info->frames *

Error: GCC_ANALYZER_WARNING: [#def3]
lv2-1.18.8-build/lv2-1.18.8/plugins/eg-sampler.lv2/sampler.c:169:42: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘load_sample’
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘load_sample’
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘load_sample’
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘load_sample’
lv2-1.18.8-build/lv2-1.18.8/plugins/eg-sampler.lv2/sampler.c:169:42: note: only use operands of an integer type inside the size argument
#  167|       const double output_length = ceil((double)info->frames * src_ratio);
#  168|       const long   output_frames = (long)output_length;
#  169|->     float* const output_buffer = (float*)malloc(sizeof(float) * output_frames);
#  170|   
#  171|       SRC_DATA src_data = {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def4]
lv2-1.18.8-build/lv2-1.18.8/plugins/eg-sampler.lv2/sampler.c:200:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(path_len + 1)’ where non-null expected
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘load_sample’
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘load_sample’
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘load_sample’
lv2-1.18.8-build/lv2-1.18.8/include/lv2/core/lv2_util.h: scope_hint: In function ‘load_sample’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  198|     sample->path     = (char*)malloc(path_len + 1);
#  199|     sample->path_len = (uint32_t)path_len;
#  200|->   memcpy(sample->path, path, path_len + 1);
#  201|   
#  202|     return sample;

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.82.0
diffbase-analyzer-version-cppcheck2.16.0
diffbase-analyzer-version-gcc14.2.1
diffbase-analyzer-version-gcc-analyzer15.0.0
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-141.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-namelv2-1.18.10-1.fc42
diffbase-store-results-to/tmp/tmp1qapcz4y/lv2-1.18.10-1.fc42.tar.xz
diffbase-time-created2024-11-13 01:56:28
diffbase-time-finished2024-11-13 01:57:57
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp1qapcz4y/lv2-1.18.10-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp1qapcz4y/lv2-1.18.10-1.fc42.src.rpm'
diffbase-tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-141.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namelv2-1.18.8-9.fc41
store-results-to/tmp/tmp772p1v8d/lv2-1.18.8-9.fc41.tar.xz
time-created2024-11-13 01:54:05
time-finished2024-11-13 01:56:08
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp772p1v8d/lv2-1.18.8-9.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp772p1v8d/lv2-1.18.8-9.fc41.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9