Task #119472 - fixed.err
back to task #119472download
Error: CPPCHECK_WARNING (CWE-476):
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):
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):
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):
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):
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):
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):
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):
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| }