Error: COMPILER_WARNING (CWE-704): [#def1] libconfig-1.8.2/examples/c/example4.c: scope_hint: In function ‘include_func’ libconfig-1.8.2/examples/c/example4.c:61:5: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 61 | p = strrchr(path, '/'); # | ^ # 59| pathbuf_append_path(path_buf, include_dir); # 60| # 61|-> p = strrchr(path, '/'); # 62| if(p > path) # 63| pathbuf_append_path_len(path_buf, path, p - path); Error: COMPILER_WARNING (CWE-704): [#def2] libconfig-1.8.2/examples/c/example4.c:61:5: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 59| pathbuf_append_path(path_buf, include_dir); # 60| # 61|-> p = strrchr(path, '/'); # 62| if(p > path) # 63| pathbuf_append_path_len(path_buf, path, p - path); Error: GCC_ANALYZER_WARNING (CWE-476): [#def3] libconfig-1.8.2/examples/c/example4.c:90:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘result_next’ libconfig-1.8.2/examples/c/example4.c:71:5: branch_true: following ‘true’ branch... libconfig-1.8.2/examples/c/example4.c:71:5: branch_true: ...to here libconfig-1.8.2/examples/c/example4.c:73:11: branch_true: following ‘true’ branch... libconfig-1.8.2/examples/c/example4.c:75:37: branch_true: ...to here libconfig-1.8.2/examples/c/example4.c:82:11: branch_true: following ‘true’ branch (when ‘result_count == result_capacity’)... libconfig-1.8.2/examples/c/example4.c:84:11: branch_true: ...to here libconfig-1.8.2/examples/c/example4.c:90:9: danger: dereference of NULL ‘result_next’ # 88| } # 89| # 90|-> *result_next = strdup(file_path); # 91| ++result_next; # 92| ++result_count; Error: GCC_ANALYZER_WARNING (CWE-476): [#def4] libconfig-1.8.2/examples/c/example4.c:102:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘result_next’ # 100| } # 101| # 102|-> *result_next = NULL; # 103| # 104| pathbuf_destroy(path_buf); Error: CPPCHECK_WARNING (CWE-476): [#def5] libconfig-1.8.2/examples/c/pathbuf.c:45: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf # 43| { # 44| pathbuf_t *buf = (pathbuf_t *)malloc(sizeof(pathbuf_t)); # 45|-> buf->path = (char *)malloc(PATHBUF_BLOCK_SIZE * sizeof(char)); # 46| *(buf->path) = 0; # 47| buf->length = 0; Error: GCC_ANALYZER_WARNING (CWE-476): [#def6] libconfig-1.8.2/examples/c/pathbuf.c:45:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buf’ libconfig-1.8.2/examples/c/pathbuf.c:44:33: acquire_memory: this call could return NULL libconfig-1.8.2/examples/c/pathbuf.c:45:3: danger: ‘buf’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 43| { # 44| pathbuf_t *buf = (pathbuf_t *)malloc(sizeof(pathbuf_t)); # 45|-> buf->path = (char *)malloc(PATHBUF_BLOCK_SIZE * sizeof(char)); # 46| *(buf->path) = 0; # 47| buf->length = 0; Error: CPPCHECK_WARNING (CWE-476): [#def7] libconfig-1.8.2/examples/c/pathbuf.c:46: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf # 44| pathbuf_t *buf = (pathbuf_t *)malloc(sizeof(pathbuf_t)); # 45| buf->path = (char *)malloc(PATHBUF_BLOCK_SIZE * sizeof(char)); # 46|-> *(buf->path) = 0; # 47| buf->length = 0; # 48| buf->capacity = PATHBUF_BLOCK_SIZE; Error: GCC_ANALYZER_WARNING (CWE-476): [#def8] libconfig-1.8.2/examples/c/pathbuf.c:46:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(128)’ libconfig-1.8.2/examples/c/pathbuf.c:45:23: acquire_memory: this call could return NULL libconfig-1.8.2/examples/c/pathbuf.c:46:3: danger: ‘malloc(128)’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 44| pathbuf_t *buf = (pathbuf_t *)malloc(sizeof(pathbuf_t)); # 45| buf->path = (char *)malloc(PATHBUF_BLOCK_SIZE * sizeof(char)); # 46|-> *(buf->path) = 0; # 47| buf->length = 0; # 48| buf->capacity = PATHBUF_BLOCK_SIZE; Error: CPPCHECK_WARNING (CWE-476): [#def9] libconfig-1.8.2/examples/c/pathbuf.c:47: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf # 45| buf->path = (char *)malloc(PATHBUF_BLOCK_SIZE * sizeof(char)); # 46| *(buf->path) = 0; # 47|-> buf->length = 0; # 48| buf->capacity = PATHBUF_BLOCK_SIZE; # 49| Error: CPPCHECK_WARNING (CWE-476): [#def10] libconfig-1.8.2/examples/c/pathbuf.c:48: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf # 46| *(buf->path) = 0; # 47| buf->length = 0; # 48|-> buf->capacity = PATHBUF_BLOCK_SIZE; # 49| # 50| return(buf); Error: CPPCHECK_WARNING (CWE-401): [#def11] libconfig-1.8.2/examples/c/pathbuf.c:50: error[memleak]: Memory leak: buf.path # 48| buf->capacity = PATHBUF_BLOCK_SIZE; # 49| # 50|-> return(buf); # 51| } # 52| Error: COMPILER_WARNING: [#def12] libconfig-1.8.2/lib/grammar.c: scope_hint: In function 'libconfig_yyparse' libconfig-1.8.2/lib/grammar.c:72:25: warning[-Wunused-but-set-variable=]: variable 'libconfig_yynerrs' set but not used # 72 | #define yynerrs libconfig_yynerrs # | ^~~~~~~~~~~~~~~~~ libconfig-1.8.2/lib/grammar.c:1077:9: note: in expansion of macro 'yynerrs' # 1077 | int yynerrs = 0; # | ^~~~~~~ # 70| #define yyerror libconfig_yyerror # 71| #define yydebug libconfig_yydebug # 72|-> #define yynerrs libconfig_yynerrs # 73| # 74| /* First part of user prologue. */ Error: GCC_ANALYZER_WARNING (CWE-457): [#def13] libconfig-1.8.2/lib/grammar.c:1185:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'yyss' libconfig-1.8.2/lib/grammar.c:1143:6: branch_true: following 'true' branch... libconfig-1.8.2/lib/grammar.c:1149:28: branch_true: ...to here libconfig-1.8.2/lib/grammar.c:1172:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')... libconfig-1.8.2/lib/grammar.c:1174:7: branch_false: ...to here libconfig-1.8.2/lib/grammar.c:1183:12: branch_false: following 'false' branch... libconfig-1.8.2/lib/grammar.c:1185:9: branch_false: ...to here libconfig-1.8.2/lib/grammar.c:1185:9: danger: use of uninitialized value 'yyss' here # 1183| if (! yyptr) # 1184| YYNOMEM; # 1185|-> YYSTACK_RELOCATE (yyss_alloc, yyss); # 1186| YYSTACK_RELOCATE (yyvs_alloc, yyvs); # 1187| # undef YYSTACK_RELOCATE Error: GCC_ANALYZER_WARNING (CWE-476): [#def14] libconfig-1.8.2/lib/libconfig.c:1192:10: warning[-Wanalyzer-null-dereference]: dereference of NULL 'setting' libconfig-1.8.2/lib/libconfig.c:1599:19: enter_function: entry to 'config_setting_set_int_elem' libconfig-1.8.2/lib/libconfig.c:1606:5: branch_false: following 'false' branch... libconfig-1.8.2/lib/libconfig.c:1610:5: branch_false: ...to here libconfig-1.8.2/lib/libconfig.c:1610:5: branch_true: following 'true' branch (when 'idx < 0')... libconfig-1.8.2/lib/libconfig.c:1612:10: branch_true: ...to here libconfig-1.8.2/lib/libconfig.c:1612:7: branch_false: following 'false' branch... libconfig-1.8.2/lib/libconfig.c:1615:15: branch_false: ...to here libconfig-1.8.2/lib/libconfig.c:1615:15: call_function: calling '__config_setting_create' from 'config_setting_set_int_elem' libconfig-1.8.2/lib/libconfig.c:1615:15: return_function: returning to 'config_setting_set_int_elem' from '__config_setting_create' libconfig-1.8.2/lib/libconfig.c:1625:8: call_function: calling 'config_setting_set_int' from 'config_setting_set_int_elem' # 1190| config_assert(setting != NULL); # 1191| # 1192|-> switch(setting->type) # 1193| { # 1194| case CONFIG_TYPE_NONE: Error: GCC_ANALYZER_WARNING (CWE-476): [#def15] libconfig-1.8.2/lib/libconfig.c:1222:10: warning[-Wanalyzer-null-dereference]: dereference of NULL 'setting' libconfig-1.8.2/lib/libconfig.c:1647:19: enter_function: entry to 'config_setting_set_int64_elem' libconfig-1.8.2/lib/libconfig.c:1654:5: branch_false: following 'false' branch... libconfig-1.8.2/lib/libconfig.c:1658:5: branch_false: ...to here libconfig-1.8.2/lib/libconfig.c:1658:5: branch_true: following 'true' branch (when 'idx < 0')... libconfig-1.8.2/lib/libconfig.c:1660:10: branch_true: ...to here libconfig-1.8.2/lib/libconfig.c:1660:7: branch_false: following 'false' branch... libconfig-1.8.2/lib/libconfig.c:1663:15: branch_false: ...to here libconfig-1.8.2/lib/libconfig.c:1663:15: call_function: calling '__config_setting_create' from 'config_setting_set_int64_elem' libconfig-1.8.2/lib/libconfig.c:1663:15: return_function: returning to 'config_setting_set_int64_elem' from '__config_setting_create' libconfig-1.8.2/lib/libconfig.c:1673:8: call_function: calling 'config_setting_set_int64' from 'config_setting_set_int64_elem' # 1220| config_assert(setting != NULL); # 1221| # 1222|-> switch(setting->type) # 1223| { # 1224| case CONFIG_TYPE_NONE: Error: GCC_ANALYZER_WARNING (CWE-476): [#def16] libconfig-1.8.2/lib/scanner.c:2222:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'b' libconfig-1.8.2/lib/scanner.c:2101:10: enter_function: entry to 'libconfig_yyrestart' libconfig-1.8.2/lib/scanner.c:2108:13: call_function: calling 'libconfig_yy_create_buffer' from 'libconfig_yyrestart' libconfig-1.8.2/lib/scanner.c:2108:13: return_function: returning to 'libconfig_yyrestart' from 'libconfig_yy_create_buffer' libconfig-1.8.2/lib/scanner.c:2111:9: branch_false: following 'false' branch... libconfig-1.8.2/lib/scanner.c:2111:9: branch_false: ...to here libconfig-1.8.2/lib/scanner.c:2111:9: call_function: calling 'libconfig_yy_init_buffer' from 'libconfig_yyrestart' # 2220| yy_flush_buffer( b , yyscanner); # 2221| # 2222|-> b->yy_input_file = file; # 2223| b->yy_fill_buffer = 1; # 2224| Error: CPPCHECK_WARNING (CWE-476): [#def17] libconfig-1.8.2/tests/tests.c:127: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf # 125| TT_ASSERT_PTR_NOTNULL(fp); # 126| # 127|-> r = fread(buf, 1, size, fp); # 128| fclose(fp); # 129| Error: CPPCHECK_WARNING (CWE-476): [#def18] libconfig-1.8.2/tests/tests.c:127: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp # 125| TT_ASSERT_PTR_NOTNULL(fp); # 126| # 127|-> r = fread(buf, 1, size, fp); # 128| fclose(fp); # 129| Error: CPPCHECK_WARNING (CWE-476): [#def19] libconfig-1.8.2/tests/tests.c:176: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp # 174| fp = fopen(error_file, "rt"); # 175| TT_ASSERT_PTR_NOTNULL(fp); # 176|-> TT_ASSERT_PTR_NOTNULL(fgets(error_text, sizeof(error_text), fp)); # 177| fclose(fp); # 178| Error: CPPCHECK_WARNING (CWE-476): [#def20] libconfig-1.8.2/tests/tests.c:206: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp # 204| fp = fopen(error_file, "rt"); # 205| TT_ASSERT_PTR_NOTNULL(fp); # 206|-> TT_ASSERT_PTR_NOTNULL(fgets(error_text, sizeof(error_text), fp)); # 207| fclose(fp); # 208| Error: CPPCHECK_WARNING (CWE-476): [#def21] libconfig-1.8.2/tests/tests.c:661: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: stream # 659| ok = config_read(&cfg, stream); # 660| # 661|-> fclose(stream); # 662| # 663| if(!ok) Error: CPPCHECK_WARNING (CWE-476): [#def22] libconfig-1.8.2/tinytest/tinytest.c:228: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: suite # 226| { # 227| tt_testsuite_t *suite = calloc(1, sizeof(tt_testsuite_t)); # 228|-> suite->name = strdup(name); # 229| return(suite); # 230| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def23] libconfig-1.8.2/tinytest/tinytest.c:228:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘suite’ libconfig-1.8.2/tinytest/tinytest.c:227:27: acquire_memory: this call could return NULL libconfig-1.8.2/tinytest/tinytest.c:228:3: danger: ‘suite’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 226| { # 227| tt_testsuite_t *suite = calloc(1, sizeof(tt_testsuite_t)); # 228|-> suite->name = strdup(name); # 229| return(suite); # 230| } Error: CPPCHECK_WARNING (CWE-401): [#def24] libconfig-1.8.2/tinytest/tinytest.c:229: error[memleak]: Memory leak: suite.name # 227| tt_testsuite_t *suite = calloc(1, sizeof(tt_testsuite_t)); # 228| suite->name = strdup(name); # 229|-> return(suite); # 230| } # 231| Error: CPPCHECK_WARNING (CWE-476): [#def25] libconfig-1.8.2/tinytest/tinytest.c:258: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: test # 256| { # 257| tt_test_t *test = calloc(1, sizeof(tt_test_t)); # 258|-> test->name = strdup(name); # 259| test->function = function; # 260| Error: GCC_ANALYZER_WARNING (CWE-476): [#def26] libconfig-1.8.2/tinytest/tinytest.c:258:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘test’ libconfig-1.8.2/tinytest/tinytest.c:257:21: acquire_memory: this call could return NULL libconfig-1.8.2/tinytest/tinytest.c:258:3: danger: ‘test’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 256| { # 257| tt_test_t *test = calloc(1, sizeof(tt_test_t)); # 258|-> test->name = strdup(name); # 259| test->function = function; # 260| Error: CPPCHECK_WARNING (CWE-476): [#def27] libconfig-1.8.2/tinytest/tinytest.c:259: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: test # 257| tt_test_t *test = calloc(1, sizeof(tt_test_t)); # 258| test->name = strdup(name); # 259|-> test->function = function; # 260| # 261| if(suite->last_test != NULL)
| analyzer-version-clippy | 1.97.1 |
| analyzer-version-cppcheck | 2.21.1 |
| analyzer-version-gcc | 16.1.1 |
| analyzer-version-gcc-analyzer | 16.1.1 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-51.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | libconfig-1.8.2-2.fc44 |
| store-results-to | /tmp/tmpyrx_mm52/libconfig-1.8.2-2.fc44.tar.xz |
| time-created | 2026-08-03 17:02:55 |
| time-finished | 2026-08-03 17:05:04 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpyrx_mm52/libconfig-1.8.2-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpyrx_mm52/libconfig-1.8.2-2.fc44.src.rpm' |
| tool-version | csmock-3.8.7.20260803.142340.gb75b18e-1.el9 |