Task #891 - lilv-0.24.20-4.fc41/scan-results.err
back to task #891download
Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c: scope_hint: In function ‘lilv_path_parent’ lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:199:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘dirname’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 197| // Pointing to the last character of the result (inclusive) # 198| char* dirname = (char*)malloc(s - path + 2); # 199|-> memcpy(dirname, path, s - path + 1); # 200| dirname[s - path + 1] = '\0'; # 201| return dirname; Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c: scope_hint: In function ‘lilv_path_filename’ lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:222:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ret’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strncpy’ must be non-null # 220| char* const ret = (char*)calloc(ret_len + 1, 1); # 221| # 222|-> strncpy(ret, path + last_sep + 1, ret_len); # 223| return ret; # 224| } Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c: scope_hint: In function ‘lilv_path_join’ lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:238:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘path’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 236| const size_t pre_len = a_len - (a_end_is_sep ? 1 : 0); # 237| char* path = (char*)calloc(1, a_len + b_len + 2); # 238|-> memcpy(path, a, pre_len); # 239| # 240| #ifndef _WIN32 Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c: scope_hint: In function ‘lilv_copy_file’ lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:321:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘page’ where non-null expected lilv-0.24.20-build/lilv-0.24.20/src/filesystem.h:5: included_from: Included from here. lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:4: included_from: Included from here. /usr/include/stdio.h:735:15: note: argument 1 of ‘fwrite’ must be non-null # 319| int st = 0; # 320| while ((n_read = fread(page, 1, PAGE_SIZE, in)) > 0) { # 321|-> if (fwrite(page, 1, n_read, out) != n_read) { # 322| st = errno; # 323| break; Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c: scope_hint: In function ‘lilv_symlink’ lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:352:11: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘lilv_path_relative_to(oldpath, newpath)’ where non-null expected lilv-0.24.20-build/lilv-0.24.20/src/lilv_config.h:27: included_from: Included from here. lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:5: included_from: Included from here. /usr/include/unistd.h:832:12: note: argument 1 of ‘symlink’ must be non-null # 350| char* target = lilv_path_relative_to(oldpath, newpath); # 351| # 352|-> ret = symlink(target, newpath); # 353| # 354| free(target); Error: CLANG_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:448:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'path_pattern' # 446| char* const path_pattern = lilv_path_join(parent, pattern); # 447| # 448|-> return mkdtemp(path_pattern); // NOLINT (not a leak) # 449| #endif # 450| } Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c: scope_hint: In function ‘lilv_create_temporary_directory_in’ lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:448:10: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:29: included_from: Included from here. /usr/include/stdlib.h:870:14: note: argument 1 of ‘mkdtemp’ must be non-null # 446| char* const path_pattern = lilv_path_join(parent, pattern); # 447| # 448|-> return mkdtemp(path_pattern); // NOLINT (not a leak) # 449| #endif # 450| } Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c: scope_hint: In function ‘lilv_file_equals’ lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:528:8: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected lilv-0.24.20-build/lilv-0.24.20/src/filesystem.c:30: included_from: Included from here. /usr/include/string.h:156:12: note: argument 2 of ‘strcmp’ must be non-null # 526| char* const a_real = lilv_path_canonical(a_path); # 527| char* const b_real = lilv_path_canonical(b_path); # 528|-> if (!strcmp(a_real, b_real)) { # 529| match = true; // Real paths match # 530| } else if (lilv_file_size(a_path) != lilv_file_size(b_path)) { Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/instance.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/instance.c: scope_hint: In function ‘lilv_plugin_instantiate’ lilv-0.24.20-build/lilv-0.24.20/src/instance.c:45:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘local_features’ # 43| if (features == NULL) { # 44| local_features = (const LV2_Feature**)malloc(sizeof(LV2_Feature*)); # 45|-> local_features[0] = NULL; # 46| } # 47| Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/instance.c:62:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’ # 60| // Create LilvInstance to return # 61| result = (LilvInstance*)malloc(sizeof(LilvInstance)); # 62|-> result->lv2_descriptor = ld; # 63| result->lv2_handle = ld->instantiate( # 64| ld, sample_rate, bundle_path, (features) ? features : local_features); Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/lib.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/lib.c: scope_hint: In function ‘lilv_lib_open’ lilv-0.24.20-build/lilv-0.24.20/src/lib.c:73:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘llib’ lilv-0.24.20-build/lilv-0.24.20/src/lib.c: scope_hint: In function ‘lilv_lib_open’ # 71| # 72| LilvLib* llib = (LilvLib*)malloc(sizeof(LilvLib)); # 73|-> llib->world = world; # 74| llib->uri = lilv_node_duplicate(uri); # 75| llib->bundle_path = lilv_strdup(bundle_path); Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/node.c: scope_hint: In function ‘lilv_node_new’ lilv-0.24.20-build/lilv-0.24.20/src/node.c:50:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘val’ # 48| { # 49| LilvNode* val = (LilvNode*)malloc(sizeof(LilvNode)); # 50|-> val->world = world; # 51| val->type = type; # 52| Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/node.c: scope_hint: In function ‘lilv_node_new_from_node’ lilv-0.24.20-build/lilv-0.24.20/src/node.c:105:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’ # 103| case SORD_URI: # 104| result = (LilvNode*)malloc(sizeof(LilvNode)); # 105|-> result->world = world; # 106| result->type = LILV_VALUE_URI; # 107| result->node = sord_node_copy(node); Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/node.c:111:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’ # 109| case SORD_BLANK: # 110| result = (LilvNode*)malloc(sizeof(LilvNode)); # 111|-> result->world = world; # 112| result->type = LILV_VALUE_BLANK; # 113| result->node = sord_node_copy(node); Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/node.c: scope_hint: In function ‘lilv_node_duplicate’ lilv-0.24.20-build/lilv-0.24.20/src/node.c:208:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’ # 206| # 207| LilvNode* result = (LilvNode*)malloc(sizeof(LilvNode)); # 208|-> result->world = val->world; # 209| result->node = sord_node_copy(val->node); # 210| result->val = val->val; Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/plugin.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/plugin.c: scope_hint: In function ‘lilv_plugin_load_ports_if_necessary.part.0’ lilv-0.24.20-build/lilv-0.24.20/src/plugin.c:261:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*const_plugin.ports’ # 259| if (!plugin->ports) { # 260| plugin->ports = (LilvPort**)malloc(sizeof(LilvPort*)); # 261|-> plugin->ports[0] = NULL; # 262| # 263| SordIter* ports = lilv_world_query_internal(plugin->world, Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/plugin.c:278:62: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ lilv-0.24.20-build/lilv-0.24.20/src/plugin.c:4: included_from: Included from here. lilv-0.24.20-build/lilv-0.24.20/src/plugin.c:268:5: note: in expansion of macro ‘FOREACH_MATCH’ # 276| # 277| if (!lilv_node_is_string(symbol) || # 278|-> !is_symbol((const char*)sord_node_get_string(symbol->node))) { # 279| LILV_ERRORF("Plugin <%s> port symbol `%s' is invalid\n", # 280| lilv_node_as_uri(plugin->plugin_uri), Error: CPPCHECK_WARNING (CWE-401): lilv-0.24.20-build/lilv-0.24.20/src/plugin.c:582: error[memleakOnRealloc]: Common realloc mistake: 'classes' nulled but not freed upon failure # 580| const LilvNode** classes = NULL; # 581| for (LilvNode* c = NULL; (c = va_arg(args, LilvNode*));) { # 582|-> classes = # 583| (const LilvNode**)realloc(classes, ++n_classes * sizeof(LilvNode*)); # 584| classes[n_classes - 1] = c; Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/pluginclass.c: scope_hint: In function ‘lilv_plugin_class_new’ lilv-0.24.20-build/lilv-0.24.20/src/pluginclass.c:20:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pc’ # 18| { # 19| LilvPluginClass* pc = (LilvPluginClass*)malloc(sizeof(LilvPluginClass)); # 20|-> pc->world = world; # 21| pc->uri = lilv_node_new_from_node(world, uri); # 22| pc->label = lilv_node_new(world, LILV_VALUE_STRING, label); Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/port.c: scope_hint: In function ‘lilv_port_new’ lilv-0.24.20-build/lilv-0.24.20/src/port.c:27:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘port’ # 25| { # 26| LilvPort* port = (LilvPort*)malloc(sizeof(LilvPort)); # 27|-> port->node = lilv_node_new_from_node(world, node); # 28| port->index = index; # 29| port->symbol = lilv_node_new(world, LILV_VALUE_STRING, symbol); Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/scalepoint.c: scope_hint: In function ‘lilv_scale_point_new’ lilv-0.24.20-build/lilv-0.24.20/src/scalepoint.c:15:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘point’ # 13| { # 14| LilvScalePoint* point = (LilvScalePoint*)malloc(sizeof(LilvScalePoint)); # 15|-> point->value = value; # 16| point->label = label; # 17| return point; Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/state.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/state.c: scope_hint: In function ‘append_port_value’ lilv-0.24.20-build/lilv-0.24.20/src/state.c:130:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pv’ lilv-0.24.20-build/lilv-0.24.20/src/state.c:5: included_from: Included from here. lilv-0.24.20-build/lilv-0.24.20/src/state.c:621:3: note: in expansion of macro ‘FOREACH_MATCH’ # 128| # 129| pv = &state->values[state->n_values - 1]; # 130|-> pv->symbol = lilv_strdup(port_symbol); # 131| pv->atom = (LV2_Atom*)malloc(sizeof(LV2_Atom) + size); # 132| pv->atom->size = size; Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/state.c:132:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc((long unsigned int)size + 8)’ lilv-0.24.20-build/lilv-0.24.20/src/state.c:621:3: note: in expansion of macro ‘FOREACH_MATCH’ # 130| pv->symbol = lilv_strdup(port_symbol); # 131| pv->atom = (LV2_Atom*)malloc(sizeof(LV2_Atom) + size); # 132|-> pv->atom->size = size; # 133| pv->atom->type = type; # 134| memcpy(pv->atom + 1, value, size); Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/state.c: scope_hint: In function ‘append_property’ lilv-0.24.20-build/lilv-0.24.20/src/state.c:165:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(size)’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 163| if ((flags & LV2_STATE_IS_POD) || type == state->atom_Path) { # 164| prop->value = malloc(size); # 165|-> memcpy(prop->value, value, size); # 166| } else { # 167| prop->value = (void*)value; Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/state.c: scope_hint: In function ‘new_state_from_model’ lilv-0.24.20-build/lilv-0.24.20/src/state.c:581:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘state’ # 579| // Allocate state # 580| LilvState* const state = (LilvState*)calloc(1, sizeof(LilvState)); # 581|-> state->dir = lilv_path_join(dir, NULL); # 582| state->atom_Path = map->map(map->handle, LV2_ATOM__Path); # 583| state->uri = lilv_node_new_from_node(world, node); Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/state.c:677:7: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc((long unsigned int)*atom.size)’ where non-null expected lilv-0.24.20-build/lilv-0.24.20/src/state.c:659:5: note: in expansion of macro ‘FOREACH_MATCH’ <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 675| prop.size = atom->size; # 676| prop.value = malloc(atom->size); # 677|-> memcpy(prop.value, LV2_ATOM_BODY_CONST(atom), atom->size); # 678| if (atom->type == forge.Path) { # 679| prop.flags = LV2_STATE_IS_POD; Error: GCC_ANALYZER_WARNING (CWE-401): lilv-0.24.20-build/lilv-0.24.20/src/state.c:683:28: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ lilv-0.24.20-build/lilv-0.24.20/src/state.c:659:5: note: in expansion of macro ‘FOREACH_MATCH’ lilv-0.24.20-build/lilv-0.24.20/src/state.c:659:5: note: in expansion of macro ‘FOREACH_MATCH’ # 681| # 682| if (prop.value) { # 683|-> state->props.props = (Property*)realloc( # 684| state->props.props, (++state->props.n) * sizeof(Property)); # 685| state->props.props[state->props.n - 1] = prop; Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/state.c:685:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ lilv-0.24.20-build/lilv-0.24.20/src/state.c:659:5: note: in expansion of macro ‘FOREACH_MATCH’ # 683| state->props.props = (Property*)realloc( # 684| state->props.props, (++state->props.n) * sizeof(Property)); # 685|-> state->props.props[state->props.n - 1] = prop; # 686| } # 687| } Error: CLANG_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/state.c:835:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 833| SerdWriter* writer = ttl_writer(serd_file_sink, fd, node, env); # 834| # 835|-> fseek(fd, 0, SEEK_END); # 836| if (ftell(fd) == 0) { # 837| serd_env_foreach(*env, (SerdPrefixSink)serd_writer_set_prefix, writer); Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/state.c: scope_hint: In function ‘lilv_state_set_label’ lilv-0.24.20-build/lilv-0.24.20/src/state.c:1514:3: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 1512| const size_t len = strlen(label); # 1513| state->label = (char*)realloc(state->label, len + 1); # 1514|-> memcpy(state->label, label, len + 1); # 1515| } # 1516| Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/ui.c: scope_hint: In function ‘lilv_ui_new’ lilv-0.24.20-build/lilv-0.24.20/src/ui.c:25:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ui’ # 23| # 24| LilvUI* ui = (LilvUI*)malloc(sizeof(LilvUI)); # 25|-> ui->world = world; # 26| ui->uri = uri; # 27| ui->binary_uri = binary_uri; Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/util.c: scope_hint: In function ‘lilv_strjoin’ lilv-0.24.20-build/lilv-0.24.20/src/util.c:34:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘result’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 32| char* result = (char*)malloc(len + 1); # 33| # 34|-> memcpy(result, first, len); # 35| # 36| va_list args; Error: GCC_ANALYZER_WARNING (CWE-415): lilv-0.24.20-build/lilv-0.24.20/src/util.c: scope_hint: In function ‘strappend’ lilv-0.24.20-build/lilv-0.24.20/src/util.c:140:16: warning[-Wanalyzer-double-free]: double-‘free’ of ‘dst’ # 138| strappend(char* dst, size_t* dst_len, const char* suffix, size_t suffix_len) # 139| { # 140|-> dst = (char*)realloc(dst, *dst_len + suffix_len + 1); # 141| memcpy(dst + *dst_len, suffix, suffix_len); # 142| dst[(*dst_len += suffix_len)] = '\0'; Error: GCC_ANALYZER_WARNING (CWE-401): lilv-0.24.20-build/lilv-0.24.20/src/util.c:140:29: warning[-Wanalyzer-malloc-leak]: leak of ‘strappend(dst, dst_len, "$", 1)’ # 138| strappend(char* dst, size_t* dst_len, const char* suffix, size_t suffix_len) # 139| { # 140|-> dst = (char*)realloc(dst, *dst_len + suffix_len + 1); # 141| memcpy(dst + *dst_len, suffix, suffix_len); # 142| dst[(*dst_len += suffix_len)] = '\0'; Error: GCC_ANALYZER_WARNING (CWE-401): lilv-0.24.20-build/lilv-0.24.20/src/util.c: scope_hint: In function ‘append_var’ lilv-0.24.20-build/lilv-0.24.20/src/util.c:140:29: warning[-Wanalyzer-malloc-leak]: leak of ‘strappend(out, & len, start, (long unsigned int)(s - start))’ # 138| strappend(char* dst, size_t* dst_len, const char* suffix, size_t suffix_len) # 139| { # 140|-> dst = (char*)realloc(dst, *dst_len + suffix_len + 1); # 141| memcpy(dst + *dst_len, suffix, suffix_len); # 142| dst[(*dst_len += suffix_len)] = '\0'; Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/util.c: scope_hint: In function ‘strappend’ lilv-0.24.20-build/lilv-0.24.20/src/util.c:141:3: warning[-Wanalyzer-null-argument]: use of NULL ‘dst’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 139| { # 140| dst = (char*)realloc(dst, *dst_len + suffix_len + 1); # 141|-> memcpy(dst + *dst_len, suffix, suffix_len); # 142| dst[(*dst_len += suffix_len)] = '\0'; # 143| return dst; Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/util.c: scope_hint: In function ‘lilv_expand’ lilv-0.24.20-build/lilv-0.24.20/src/util.c:184:11: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘var’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 182| // Append variable value (or $VAR_NAME if not found) # 183| char* var = (char*)calloc(t - s, 1); # 184|-> memcpy(var, s + 1, t - s - 1); # 185| out = append_var(out, &len, var); # 186| free(var); Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/util.c: scope_hint: In function ‘lilv_find_free_path’ lilv-0.24.20-build/lilv-0.24.20/src/util.c:218:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘path’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 216| const size_t in_path_len = strlen(in_path); # 217| char* path = (char*)malloc(in_path_len + 7); # 218|-> memcpy(path, in_path, in_path_len + 1); # 219| # 220| for (unsigned i = 2; i < 1000000u; ++i) { Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/world.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/world.c: scope_hint: In function ‘lilv_world_add_spec’ lilv-0.24.20-build/lilv-0.24.20/src/world.c:404:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘spec’ # 402| { # 403| LilvSpec* spec = (LilvSpec*)malloc(sizeof(LilvSpec)); # 404|-> spec->spec = sord_node_copy(specification_node); # 405| spec->bundle = sord_node_copy(bundle_node); # 406| spec->data_uris = lilv_nodes_new(); Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/src/world.c: scope_hint: In function ‘lilv_world_load_path’ lilv-0.24.20-build/lilv-0.24.20/src/world.c:982:7: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘dir’ where non-null expected lilv-0.24.20-build/lilv-0.24.20/src/world.c: scope_hint: In function ‘lilv_world_load_path’ <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 980| const size_t dir_len = sep - lv2_path; # 981| char* const dir = (char*)malloc(dir_len + 1); # 982|-> memcpy(dir, lv2_path, dir_len); # 983| dir[dir_len] = '\0'; # 984| lilv_world_load_directory(world, dir); Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/world.c: scope_hint: In function ‘lilv_world_get_symbol’ lilv-0.24.20-build/lilv-0.24.20/src/world.c:1227:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sym’ # 1225| if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c == '_') || # 1226| (i > 0 && c >= '0' && c <= '9'))) { # 1227|-> sym[i] = '_'; # 1228| } else { # 1229| sym[i] = str[i]; Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/src/world.c:1229:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sym’ # 1227| sym[i] = '_'; # 1228| } else { # 1229|-> sym[i] = str[i]; # 1230| } # 1231| } Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/zix/tree.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/zix/tree.c:307:9: warning[core.NullDereference]: Access to field 'balance' results in a dereference of a null pointer (loaded from field 'left') # 305| if (node->balance == -2) { # 306| assert(node->left); # 307|-> if (node->left->balance == 1) { # 308| replacement = rotate_left_right(node, height_change); # 309| } else { Error: CLANG_WARNING: lilv-0.24.20-build/lilv-0.24.20/src/zix/tree.c:314:9: warning[core.NullDereference]: Access to field 'balance' results in a dereference of a null pointer (loaded from field 'right') # 312| } else if (node->balance == 2) { # 313| assert(node->right); # 314|-> if (node->right->balance == -1) { # 315| replacement = rotate_right_left(node, height_change); # 316| } else { Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/test/lilv_test_uri_map.h:26:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ctx’ lilv-0.24.20-build/lilv-0.24.20/test/test_state.c: scope_hint: In function ‘test_context_new’ # 24| { # 25| map->uris = NULL; # 26|-> map->n_uris = 0; # 27| } # 28| Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/test/lilv_test_uri_map.h: scope_hint: In function ‘map_uri’ lilv-0.24.20-build/lilv-0.24.20/test/lilv_test_uri_map.h:55:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ lilv-0.24.20-build/lilv-0.24.20/test/lilv_test_uri_map.h:12: included_from: Included from here. # 53| # 54| map->uris = (char**)realloc(map->uris, ++map->n_uris * sizeof(char*)); # 55|-> map->uris[map->n_uris - 1] = lilv_strdup(uri); # 56| return map->n_uris; # 57| } Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/test/lilv_test_utils.c: scope_hint: In function ‘lilv_test_env_new’ lilv-0.24.20-build/lilv-0.24.20/test/lilv_test_utils.c:29:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘env’ # 27| LilvTestEnv* env = (LilvTestEnv*)calloc(1, sizeof(LilvTestEnv)); # 28| # 29|-> env->world = world; # 30| env->plugin1_uri = lilv_new_uri(world, "http://example.org/plug"); # 31| env->plugin2_uri = lilv_new_uri(world, "http://example.org/foobar"); Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c: scope_hint: In function ‘test_path_canonical’ lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c:240:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilvXXXXXX"), "lilv_test_file"), "w")’ where non-null expected <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 238| # 239| FILE* f = fopen(file_path, "w"); # 240|-> fprintf(f, "test\n"); # 241| fclose(f); # 242| Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c: scope_hint: In function ‘test_path_exists’ lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c:292:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilvXXXXXX"), "lilv_test_file"), "w")’ where non-null expected lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c:10: included_from: Included from here. <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 290| # 291| FILE* f = fopen(file_path, "w"); # 292|-> fprintf(f, "test\n"); # 293| fclose(f); # 294| Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c: scope_hint: In function ‘test_is_directory’ lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c:314:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilvXXXXXX"), "lilv_test_file"), "w")’ where non-null expected <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 312| # 313| FILE* f = fopen(file_path, "w"); # 314|-> fprintf(f, "test\n"); # 315| fclose(f); # 316| Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c: scope_hint: In function ‘test_copy_file’ lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c:334:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilvXXXXXX"), "lilv_test_file"), "w")’ where non-null expected <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 332| # 333| FILE* f = fopen(file_path, "w"); # 334|-> fprintf(f, "test\n"); # 335| fclose(f); # 336| Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c:347:7: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilvXXXXXX"), "lilv_test_file"), "w")’ where non-null expected <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 345| f = fopen(file_path, "w"); # 346| for (size_t i = 0; i < 4096; ++i) { # 347|-> fprintf(f, "test\n"); # 348| } # 349| fclose(f); Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c: scope_hint: In function ‘test_dir_for_each’ lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c:410:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilvXXXXXX"), "lilv_test_1"), "w")’ where non-null expected <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 408| FILE* const f1 = fopen(path1, "w"); # 409| FILE* const f2 = fopen(path2, "w"); # 410|-> fprintf(f1, "test\n"); # 411| fprintf(f2, "test\n"); # 412| fclose(f2); Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c:411:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilvXXXXXX"), "lilv_test_2"), "w")’ where non-null expected <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 409| FILE* const f2 = fopen(path2, "w"); # 410| fprintf(f1, "test\n"); # 411|-> fprintf(f2, "test\n"); # 412| fclose(f2); # 413| fclose(f1); Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c: scope_hint: In function ‘test_create_directories’ lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c:470:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilvXXXXXX"), "lilv_test_file"), "w")’ where non-null expected <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 468| FILE* const f = fopen(file_path, "w"); # 469| # 470|-> fprintf(f, "test\n"); # 471| fclose(f); # 472| Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c: scope_hint: In function ‘test_file_equals’ lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c:494:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilvXXXXXX"), "lilv_test_1"), "w")’ where non-null expected <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 492| FILE* const f1 = fopen(path1, "w"); # 493| FILE* const f2 = fopen(path2, "w"); # 494|-> fprintf(f1, "test\n"); # 495| fprintf(f2, "test\n"); # 496| Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_filesystem.c:495:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilvXXXXXX"), "lilv_test_2"), "w")’ where non-null expected <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 493| FILE* const f2 = fopen(path2, "w"); # 494| fprintf(f1, "test\n"); # 495|-> fprintf(f2, "test\n"); # 496| # 497| assert(lilv_file_equals(path1, path2)); Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c: scope_hint: In function ‘temp_directory_path’ lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c:58:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘result’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 56| char* const result = (char*)calloc(tmpdir_len + 1, 1); # 57| # 58|-> memcpy(result, tmpdir, tmpdir_len + 1); # 59| return result; # 60| } Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c:64:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘result’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 62| char* const result = (char*)calloc(6, 1); # 63| # 64|-> memcpy(result, "/tmp/", 6); # 65| return result; # 66| #endif Error: GCC_ANALYZER_WARNING (CWE-401): lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c: scope_hint: In function ‘instantiate’ lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c:137:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 135| if (!test->map) { # 136| fprintf(stderr, "Host does not support urid:map\n"); # 137|-> free(test); # 138| return NULL; # 139| } Error: CLANG_WARNING: lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c:152:5: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 150| fprintf(stderr, "ERROR: Failed to open rec file\n"); # 151| } # 152|-> fprintf(test->rec_file, "instantiate\n"); # 153| } # 154| Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c: scope_hint: In function ‘save’ lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c:292:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘tmp_file_path’ where non-null expected lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c: scope_hint: In function ‘save’ lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c: scope_hint: In function ‘save’ lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c: scope_hint: In function ‘save’ <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 290| (char*)calloc(dir_path_len + file_name_len + 1, 1); # 291| # 292|-> memcpy(tmp_file_path, plugin->tmp_dir_path, dir_path_len); # 293| memcpy(tmp_file_path + dir_path_len, file_name, file_name_len + 1); # 294| Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c: scope_hint: In function ‘restore’ lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c:408:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(*map_path.absolute_path(*map_path.handle, retrieve(callback_data, *MEM[(struct Test *)instance_38(D)].map.map(*MEM[(struct Test *)instance_38(D)].map.handle, "http://example.org/extfile"), &size, & type, & valflags)), "r")’ where non-null expected lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c: scope_hint: In function ‘restore’ lilv-0.24.20-build/lilv-0.24.20/test/test_plugin.lv2/test_plugin.c:15: included_from: Included from here. /usr/include/stdio.h:728:15: note: argument 4 of ‘fread’ must be non-null # 406| FILE* f = fopen(path, "r"); # 407| char str[8]; # 408|-> size_t n_read = fread(str, 1, sizeof(str), f); # 409| fclose(f); # 410| if (strncmp(str, "Hello\n", n_read)) { Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_util.c: scope_hint: In function ‘main’ lilv-0.24.20-build/lilv-0.24.20/test/test_util.c:24:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilv_test_util_XXXXXX"), "copy_a_XXXXXX"), "w")’ where non-null expected lilv-0.24.20-build/lilv-0.24.20/test/test_util.c:10: included_from: Included from here. <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 22| FILE* const fa = fopen(a_path, "w"); # 23| FILE* const fb = fopen(b_path, "w"); # 24|-> fprintf(fa, "AA\n"); # 25| fprintf(fb, "AB\n"); # 26| fclose(fb); Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/test/test_util.c:25:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(lilv_path_join(lilv_create_temporary_directory("lilv_test_util_XXXXXX"), "copy_b_XXXXXX"), "w")’ where non-null expected <built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null # 23| FILE* const fb = fopen(b_path, "w"); # 24| fprintf(fa, "AA\n"); # 25|-> fprintf(fb, "AB\n"); # 26| fclose(fb); # 27| fclose(fa); Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/tools/lv2apply.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/tools/lv2apply.c: scope_hint: In function ‘main’ lilv-0.24.20-build/lilv-0.24.20/tools/lv2apply.c:247:44: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 245| self.params = # 246| (Param*)realloc(self.params, ++self.n_params * sizeof(Param)); # 247|-> self.params[self.n_params - 1].sym = argv[++i]; # 248| self.params[self.n_params - 1].value = atof(argv[++i]); # 249| } else if (argv[i][0] == '-') { Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/tools/lv2bench.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: lilv-0.24.20-build/lilv-0.24.20/tools/lv2info.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): lilv-0.24.20-build/lilv-0.24.20/tools/lv2bench.c:11: included_from: Included from here. lilv-0.24.20-build/lilv-0.24.20/tools/uri_table.h: scope_hint: In function ‘uri_table_map’ lilv-0.24.20-build/lilv-0.24.20/tools/uri_table.h:52:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ lilv-0.24.20-build/lilv-0.24.20/tools/lv2bench.c: scope_hint: In function ‘uri_table_map’ # 50| const size_t len = strlen(uri); # 51| table->uris = (char**)realloc(table->uris, ++table->n_uris * sizeof(char*)); # 52|-> table->uris[table->n_uris - 1] = (char*)malloc(len + 1); # 53| memcpy(table->uris[table->n_uris - 1], uri, len + 1); # 54| return table->n_uris; Error: GCC_ANALYZER_WARNING (CWE-688): lilv-0.24.20-build/lilv-0.24.20/tools/uri_table.h:53:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(len + 1)’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 51| table->uris = (char**)realloc(table->uris, ++table->n_uris * sizeof(char*)); # 52| table->uris[table->n_uris - 1] = (char*)malloc(len + 1); # 53|-> memcpy(table->uris[table->n_uris - 1], uri, len + 1); # 54| return table->n_uris; # 55| }