Newly introduced defects

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1]
liblc3-1.1.1-build/liblc3-1.1.1/src/ltpf.c:498:31: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘r[0]’
liblc3-1.1.1-build/liblc3-1.1.1/src/ltpf.c: scope_hint: In function ‘detect_pitch’
#  496|       int arg;
#  497|   
#  498|->     float xw_max = (*x_max = x[arg = 0]);
#  499|       float w = 1 + w_incr;
#  500|   

Error: CLANG_WARNING: [#def2]
liblc3-1.1.1-build/liblc3-1.1.1/src/sns.c:305:11: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  303|       const float *ge = ge_table[sr];
#  304|   
#  305|->     float e0 = e[0], e1 = e[0], e2;
#  306|       float e_sum = 0;
#  307|   

Error: CLANG_WARNING: [#def3]
liblc3-1.1.1-build/liblc3-1.1.1/src/sns.c:309:46: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  307|   
#  308|       for (int i = 0; i < LC3_MAX_BANDS-1; ) {
#  309|->         e[i] = (e0 * 0.25f + e1 * 0.5f + (e2 = e[i+1]) * 0.25f) * ge[i];
#  310|           e_sum += e[i++];
#  311|   

Error: CLANG_WARNING: [#def4]
liblc3-1.1.1-build/liblc3-1.1.1/src/sns.c:312:46: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  310|           e_sum += e[i++];
#  311|   
#  312|->         e[i] = (e1 * 0.25f + e2 * 0.5f + (e0 = e[i+1]) * 0.25f) * ge[i];
#  313|           e_sum += e[i++];
#  314|   

Error: CLANG_WARNING: [#def5]
liblc3-1.1.1-build/liblc3-1.1.1/src/sns.c:315:46: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  313|           e_sum += e[i++];
#  314|   
#  315|->         e[i] = (e2 * 0.25f + e0 * 0.5f + (e1 = e[i+1]) * 0.25f) * ge[i];
#  316|           e_sum += e[i++];
#  317|       }

Error: CLANG_WARNING: [#def6]
liblc3-1.1.1-build/liblc3-1.1.1/src/spec.c:156:41: warning[core.UndefinedBinaryOperatorResult]: The left operand of '<' is a garbage value
#  154|           int v = 0;
#  155|   
#  156|->         for (j = j0; j >= 0 && e[j].q16 < gn; j--);
#  157|   
#  158|           for (j1 = j; j >= 0; j--) {

Error: CLANG_WARNING: [#def7]
liblc3-1.1.1-build/liblc3-1.1.1/src/spec.c:159:35: warning[core.UndefinedBinaryOperatorResult]: The left operand of '-' is a garbage value
#  157|   
#  158|           for (j1 = j; j >= 0; j--) {
#  159|->             int e_diff = e[j].q16 - gn;
#  160|   
#  161|               v += e_diff < 0 ? k_2u7 :

Error: CLANG_WARNING: [#def8]
liblc3-1.1.1-build/liblc3-1.1.1/src/spec.c:231:65: warning[core.DivideZero]: Division by zero
#  229|               (dt <= LC3_DT_2M5) * (1 + (nbits >= 520));
#  230|   
#  231|->         int g_incr = factor + (factor * (nbits - nbits_budget)) / delta;
#  232|           return LC3_MIN(g_idx + g_incr, 255) - g_idx;
#  233|       }

Error: CPPCHECK_WARNING (CWE-457): [#def9]
liblc3-1.1.1-build/liblc3-1.1.1/tools/elc3.c:270: warning[uninitvar]: Uninitialized variable: out
#  268|           }
#  269|   
#  270|->         lc3bin_write_data(fp_out, out, block_bytes);
#  271|       }
#  272|   

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
diffbase-analyzer-version-clang18.1.7
diffbase-analyzer-version-cppcheck2.14.2
diffbase-analyzer-version-gcc14.1.1
diffbase-analyzer-version-gcc-analyzer14.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-151.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-nameliblc3-1.0.4-4.fc40
diffbase-store-results-to/tmp/tmpchvojyhb/liblc3-1.0.4-4.fc40.tar.xz
diffbase-time-created2024-07-03 14:50:06
diffbase-time-finished2024-07-03 14:51:24
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpchvojyhb/liblc3-1.0.4-4.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpchvojyhb/liblc3-1.0.4-4.fc40.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-151.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-nameliblc3-1.1.1-2.fc41
store-results-to/tmp/tmprsglf2tp/liblc3-1.1.1-2.fc41.tar.xz
time-created2024-07-03 14:51:48
time-finished2024-07-03 14:52:44
titleNewly introduced defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmprsglf2tp/liblc3-1.1.1-2.fc41.tar.xz' '--gcc-analyze' '/tmp/tmprsglf2tp/liblc3-1.1.1-2.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9