Fixed findings

List of Findings

Error: CPPCHECK_WARNING (CWE-476): [#def1]
snowball-3.0.1/compiler/generator.c:237: error[ctunullpointer]: Null pointer dereference: p
#  235|   
#  236|   static void winc(struct generator * g, struct node * p) {     /* increment c */
#  237|->     write_string(g, p->mode == m_forward ? "z->c++;" :
#  238|                                    "z->c--;");
#  239|   }

Error: CPPCHECK_WARNING (CWE-562): [#def2]
snowball-3.0.1/compiler/generator.c:1644: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
# 1642|           if (p->mode == m_forward) {
# 1643|               sprintf(buf, "z->p[z->c + %d]", shortest_size - 1);
# 1644|->             g->S[1] = buf;
# 1645|               if (shortest_size == 1) {
# 1646|                   writef(g, "~Mif (z->c >= z->l", p);

Error: CPPCHECK_WARNING (CWE-562): [#def3]
snowball-3.0.1/compiler/generator_ada.c:1258: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
# 1256|                   sprintf(buf, "Z.C + %d", shortest_size - 1);
# 1257|               snprintf(buf2, sizeof(buf2), "Character'Pos (Z.P (%s + 1))", buf);
# 1258|->             g->S[1] = buf;
# 1259|               g->S[2] = buf2;
# 1260|               if (shortest_size == 1) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def4]
snowball-3.0.1/compiler/space.c:173:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘p’
snowball-3.0.1/compiler/space.c:265:13: enter_function: entry to ‘str_append_int’
snowball-3.0.1/compiler/space.c:268:5: call_function: calling ‘str_append_string’ from ‘str_append_int’
#  171|   extern byte * increase_capacity_s(byte * p, int n) {
#  172|       byte * q = create_s(CAPACITY(p) + n + EXTENDER);
#  173|->     memmove(q, p, CAPACITY(p));
#  174|       SIZE(q) = SIZE(p);
#  175|       lose_s(p);

Error: CPPCHECK_WARNING (CWE-401): [#def5]
snowball-3.0.1/runtime/utilities.c:371: error[memleak]: Memory leak: mem
#  369|       q = (symbol *) (HEAD + (char *)mem);
#  370|       CAPACITY(q) = new_size;
#  371|->     return q;
#  372|   }
#  373|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
snowball-3.0.1/runtime/utilities.c:406:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
snowball-3.0.1/runtime/utilities.c:379:12: enter_function: entry to ‘replace_s’
snowball-3.0.1/runtime/utilities.c:383:8: branch_true: following ‘true’ branch...
snowball-3.0.1/runtime/utilities.c:384:16: branch_true: ...to here
snowball-3.0.1/runtime/utilities.c:384:16: call_function: calling ‘create_s’ from ‘replace_s’
snowball-3.0.1/runtime/utilities.c:384:16: return_function: returning to ‘replace_s’ from ‘create_s’
snowball-3.0.1/runtime/utilities.c:385:12: branch_false: following ‘false’ branch...
snowball-3.0.1/runtime/utilities.c:387:27: branch_false: ...to here
snowball-3.0.1/runtime/utilities.c:404:8: branch_false: following ‘false’ branch (when ‘s_size == 0’)...
snowball-3.0.1/runtime/utilities.c:405:8: branch_false: ...to here
snowball-3.0.1/runtime/utilities.c:405:8: branch_true: following ‘true’ branch (when ‘adjptr’ is non-NULL)...
snowball-3.0.1/runtime/utilities.c:406:9: branch_true: ...to here
snowball-3.0.1/runtime/utilities.c:406:9: danger: ‘<unknown>’ leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#  404|       if (s_size) memmove(z->p + c_bra, s, s_size * sizeof(symbol));
#  405|       if (adjptr != NULL)
#  406|->         *adjptr = adjustment;
#  407|       return 0;
#  408|   }

Error: GCC_ANALYZER_WARNING (CWE-465): [#def7]
snowball-3.0.1/runtime/utilities.c:462:16: warning[-Wanalyzer-deref-before-check]: check of ‘p’ for NULL after already dereferencing it
snowball-3.0.1/runtime/utilities.c:453:17: enter_function: entry to ‘slice_to’
snowball-3.0.1/runtime/utilities.c:454:8: branch_false: following ‘false’ branch...
snowball-3.0.1/runtime/utilities.c:459:19: branch_false: ...to here
snowball-3.0.1/runtime/utilities.c:460:12: branch_true: following ‘true’ branch...
snowball-3.0.1/runtime/utilities.c:461:17: branch_true: ...to here
snowball-3.0.1/runtime/utilities.c:461:17: call_function: calling ‘increase_size’ from ‘slice_to’
snowball-3.0.1/runtime/utilities.c:461:17: return_function: returning to ‘slice_to’ from ‘increase_size’
snowball-3.0.1/runtime/utilities.c:462:16: danger: pointer ‘p’ is checked for NULL here but it was already dereferenced at [(4)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/3)
#  460|           if (CAPACITY(p) < len) {
#  461|               p = increase_size(p, len);
#  462|->             if (p == NULL)
#  463|                   return NULL;
#  464|           }

Error: GCC_ANALYZER_WARNING (CWE-465): [#def8]
snowball-3.0.1/runtime/utilities.c:475:12: warning[-Wanalyzer-deref-before-check]: check of ‘p’ for NULL after already dereferencing it
snowball-3.0.1/runtime/utilities.c:471:17: enter_function: entry to ‘assign_to’
snowball-3.0.1/runtime/utilities.c:473:8: branch_true: following ‘true’ branch...
snowball-3.0.1/runtime/utilities.c:474:13: branch_true: ...to here
snowball-3.0.1/runtime/utilities.c:474:13: call_function: calling ‘increase_size’ from ‘assign_to’
snowball-3.0.1/runtime/utilities.c:474:13: return_function: returning to ‘assign_to’ from ‘increase_size’
snowball-3.0.1/runtime/utilities.c:475:12: danger: pointer ‘p’ is checked for NULL here but it was already dereferenced at [(2)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/1)
#  473|       if (CAPACITY(p) < len) {
#  474|           p = increase_size(p, len);
#  475|->         if (p == NULL)
#  476|               return NULL;
#  477|       }

Scan Properties

analyzer-version-clippy1.95.0
analyzer-version-cppcheck2.20.0
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.95.0
diffbase-analyzer-version-cppcheck2.20.0
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-167.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-namesnowball-3.1.0-1.fc45
diffbase-store-results-to/tmp/tmp4oeniuqo/snowball-3.1.0-1.fc45.tar.xz
diffbase-time-created2026-06-01 16:49:15
diffbase-time-finished2026-06-01 16:52:00
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,cppcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmp4oeniuqo/snowball-3.1.0-1.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp4oeniuqo/snowball-3.1.0-1.fc45.src.rpm'
diffbase-tool-versioncsmock-3.8.5.20260529.133039.g6f3b5c6-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-167.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-namesnowball-3.0.1-11.fc44
store-results-to/tmp/tmpj32ub64n/snowball-3.0.1-11.fc44.tar.xz
time-created2026-06-01 16:46:11
time-finished2026-06-01 16:48:58
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,cppcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmpj32ub64n/snowball-3.0.1-11.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpj32ub64n/snowball-3.0.1-11.fc44.src.rpm'
tool-versioncsmock-3.8.5.20260529.133039.g6f3b5c6-1.el9