kmod-33-1.fc42

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
kmod-33-build/kmod-33/libkmod/libkmod-builtin.c: scope_hint: In function 'get_string'
kmod-33-build/kmod-33/libkmod/libkmod-builtin.c:131:35: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  129|   		if (iter->bufsz < linesz + partsz) {
#  130|   			iter->bufsz = linesz + partsz;
#  131|-> 			iter->buf = realloc(iter->buf, iter->bufsz);
#  132|   
#  133|   			if (!iter->buf) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2]
kmod-33-build/kmod-33/libkmod/libkmod-builtin.c:139:17: warning[-Wanalyzer-null-argument]: use of NULL 'modname' where non-null expected
<built-in>: note: argument 1 of '__builtin_strncpy' must be non-null
#  137|   		}
#  138|   
#  139|-> 		strncpy(iter->buf + linesz, buf, partsz);
#  140|   		linesz += partsz;
#  141|   	}

Error: GCC_ANALYZER_WARNING (CWE-415): [#def3]
kmod-33-build/kmod-33/libkmod/libkmod-builtin.c: scope_hint: In function 'kmod_builtin_iter_next'
kmod-33-build/kmod-33/libkmod/libkmod-builtin.c:200:9: warning[-Wanalyzer-double-free]: double-'free' of 'modname'
#  198|   	iter->next = pos;
#  199|   
#  200|-> 	free(modname);
#  201|   
#  202|   	return (iter->pos < iter->size);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def4]
kmod-33-build/kmod-33/libkmod/libkmod-builtin.c: scope_hint: In function 'kmod_builtin_iter_get_modname'
kmod-33-build/kmod-33/libkmod/libkmod-builtin.c:226:15: warning[-Wanalyzer-null-argument]: use of NULL 'line' where non-null expected
<built-in>: note: argument 1 of '__builtin_strchr' must be non-null
#  224|   	}
#  225|   
#  226|-> 	dot = strchr(line, '.');
#  227|   	if (!dot) {
#  228|   		sv_errno = errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_command'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:133:37: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(modnamelen + commandlen + 8)'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:825:28: note: in expansion of macro 'streq'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:833:28: note: in expansion of macro 'streq'
#  131|   		return -ENOMEM;
#  132|   
#  133|-> 	cmd->command = sizeof(*cmd) + modnamelen + (char *)cmd;
#  134|   	memcpy(cmd->modname, modname, modnamelen);
#  135|   	memcpy(cmd->command, command, commandlen);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_options'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:170:37: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(modnamelen + optionslen + 8)'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:825:28: note: in expansion of macro 'streq'
#  168|   		return -ENOMEM;
#  169|   
#  170|-> 	opt->options = sizeof(*opt) + modnamelen + (char *)opt;
#  171|   
#  172|   	memcpy(opt->modname, modname, modnamelen);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_alias'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:208:38: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(namelen + modnamelen + 8)'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
#  206|   		return -ENOMEM;
#  207|   
#  208|-> 	alias->name = sizeof(*alias) + modnamelen + (char *)alias;
#  209|   
#  210|   	memcpy(alias->modname, modname, modnamelen);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_blacklist'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:244:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(modname)'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
#  242|   		return -ENOMEM;
#  243|   
#  244|-> 	list = kmod_list_append(config->blacklists, p);
#  245|   	if (!list)
#  246|   		return -ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_softdep'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:392:26: warning[-Wanalyzer-malloc-leak]: leak of 'dep'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:825:28: note: in expansion of macro 'streq'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:833:28: note: in expansion of macro 'streq'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:842:28: note: in expansion of macro 'streq'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:851:28: note: in expansion of macro 'streq'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:18:43: note: in definition of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:317:9: note: in expansion of macro 'DBG'
#  390|   		return -ENOMEM;
#  391|   	}
#  392|-> 	config->softdeps = list;
#  393|   
#  394|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'conf_files_insert_sorted'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:999:23: warning[-Wanalyzer-malloc-leak]: leak of 'cf'
#  997|   
#  998|   	if (lpos == NULL || lpos == *list)
#  999|-> 		*list = tmp;
# 1000|   
# 1001|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def11]
kmod-33-build/kmod-33/libkmod/libkmod-index.c: scope_hint: In function 'index_read.part.0'
kmod-33-build/kmod-33/libkmod/libkmod-index.c:250:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'node'
kmod-33-build/kmod-33/libkmod/libkmod-index.c:15: included_from: Included from here.
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro 'NOFAIL'
kmod-33-build/kmod-33/libkmod/libkmod-index.c: scope_hint: In function 'index_read.part.0'
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro 'NOFAIL'
#  248|   				     sizeof(uint32_t) * child_count));
#  249|   
#  250|-> 		node->first = first;
#  251|   		node->last = last;
#  252|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def12]
kmod-33-build/kmod-33/libkmod/libkmod-index.c:257:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'node'
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro 'NOFAIL'
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro 'NOFAIL'
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro 'NOFAIL'
#  255|   	} else {
#  256|   		node = NOFAIL(malloc(sizeof(struct index_node_f)));
#  257|-> 		node->first = INDEX_CHILDMAX;
#  258|   		node->last = 0;
#  259|   	}

Error: CPPCHECK_WARNING (CWE-401): [#def13]
kmod-33-build/kmod-33/libkmod/libkmod-list.c:108: error[memleak]: Memory leak: new
#  106|   	list_node_append(list ? &list->node : NULL, &new->node);
#  107|   
#  108|-> 	return list ? list : new;
#  109|   }
#  110|   

Error: CPPCHECK_WARNING (CWE-401): [#def14]
kmod-33-build/kmod-33/libkmod/libkmod-list.c:126: error[memleak]: Memory leak: new
#  124|   	list_node_insert_after(&list->node, &new->node);
#  125|   
#  126|-> 	return list;
#  127|   }
#  128|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def15]
kmod-33-build/kmod-33/libkmod/libkmod-module.c: scope_hint: In function 'kmod_module_parse_depline'
kmod-33-build/kmod-33/libkmod/libkmod-module.c:184:24: warning[-Wanalyzer-null-argument]: use of NULL 'depmod' where non-null expected
kmod-33-build/kmod-33/libkmod/libkmod-module.c:31: included_from: Included from here.
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:18:43: note: in definition of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-module.c:788:9: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-module.c:6: included_from: Included from here.
kmod-33-build/kmod-33/libkmod/libkmod-module.c:9: included_from: Included from here.
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-module.c:182:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-module.c:182:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:72:19: note: argument 2 of 'kmod_list_prepend' must be non-null
#  182|   		DBG(ctx, "add dep: %s\n", path);
#  183|   
#  184|-> 		list = kmod_list_prepend(list, depmod);
#  185|   		n++;
#  186|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
kmod-33-build/kmod-33/libkmod/libkmod-module.c: scope_hint: In function 'kmod_module_get_sections'
kmod-33-build/kmod-33/libkmod/libkmod-module.c:2194:27: warning[-Wanalyzer-malloc-leak]: leak of 'section'
# 2192|   
# 2193|   		namesz = strlen(dent->d_name) + 1;
# 2194|-> 		section = malloc(sizeof(*section) + namesz);
# 2195|   
# 2196|   		if (section == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
kmod-33-build/kmod-33/libkmod/libkmod-module.c: scope_hint: In function 'kmod_module_info_append'
kmod-33-build/kmod-33/libkmod/libkmod-module.c:2309:64: warning[-Wanalyzer-malloc-leak]: leak of 'kmod_module_info_new(key,  keylen,  value,  valuelen)'
# 2307|   	struct kmod_module_info *info;
# 2308|   
# 2309|-> 	info = malloc(sizeof(struct kmod_module_info) + keylen + valuelen + 2);
# 2310|   	if (info == NULL)
# 2311|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def18]
kmod-33-build/kmod-33/libkmod/libkmod-module.c: scope_hint: In function 'kmod_module_info_new'
kmod-33-build/kmod-33/libkmod/libkmod-module.c:2317:9: warning[-Wanalyzer-null-argument]: use of NULL 'value' where non-null expected
<built-in>: note: argument 2 of '__builtin_memcpy' must be non-null
# 2315|   	memcpy(info->key, key, keylen);
# 2316|   	info->key[keylen] = '\0';
# 2317|-> 	memcpy(info->value, value, valuelen);
# 2318|   	info->value[valuelen] = '\0';
# 2319|   	return info;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
kmod-33-build/kmod-33/libkmod/libkmod-module.c: scope_hint: In function 'kmod_module_get_versions'
kmod-33-build/kmod-33/libkmod/libkmod-module.c:2650:21: warning[-Wanalyzer-malloc-leak]: leak of 'kmod_module_versions_new(*<unknown>.crc, *<unknown>.symbol)'
# 2648|   		}
# 2649|   
# 2650|-> 		n = kmod_list_append(*list, mv);
# 2651|   		if (n != NULL)
# 2652|   			*list = n;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
kmod-33-build/kmod-33/libkmod/libkmod-module.c: scope_hint: In function 'kmod_module_get_symbols'
kmod-33-build/kmod-33/libkmod/libkmod-module.c:2790:21: warning[-Wanalyzer-malloc-leak]: leak of 'kmod_module_symbols_new(*<unknown>.crc, *<unknown>.symbol)'
# 2788|   		}
# 2789|   
# 2790|-> 		n = kmod_list_append(*list, mv);
# 2791|   		if (n != NULL)
# 2792|   			*list = n;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
kmod-33-build/kmod-33/libkmod/libkmod-module.c: scope_hint: In function 'kmod_module_get_dependency_symbols'
kmod-33-build/kmod-33/libkmod/libkmod-module.c:2935:21: warning[-Wanalyzer-malloc-leak]: leak of 'kmod_module_dependency_symbols_new(*<unknown>.crc, (int)(*<unknown>.bind & (enum kmod_symbol_bind)255), *<unknown>.symbol)'
# 2933|   		}
# 2934|   
# 2935|-> 		n = kmod_list_append(*list, mv);
# 2936|   		if (n != NULL)
# 2937|   			*list = n;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def22]
kmod-33-build/kmod-33/shared/util.h:88:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'alias'
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_alias'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
#   86|   /* ************************************************************************ */
#   87|   static inline void freep(void *p) {
#   88|->         free(*(void**) p);
#   89|   }
#   90|   #define _cleanup_free_ _cleanup_(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def23]
kmod-33-build/kmod-33/shared/util.h:88:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'cmd'
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_command'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:825:28: note: in expansion of macro 'streq'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:833:28: note: in expansion of macro 'streq'
#   86|   /* ************************************************************************ */
#   87|   static inline void freep(void *p) {
#   88|->         free(*(void**) p);
#   89|   }
#   90|   #define _cleanup_free_ _cleanup_(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def24]
kmod-33-build/kmod-33/shared/util.h:88:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'line'
kmod-33-build/kmod-33/libkmod/libkmod.c: scope_hint: In function 'kmod_lookup_alias_is_builtin'
kmod-33-build/kmod-33/libkmod/libkmod.c:24: included_from: Included from here.
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod.c:526:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod.c:526:17: note: in expansion of macro 'DBG'
#   86|   /* ************************************************************************ */
#   87|   static inline void freep(void *p) {
#   88|->         free(*(void**) p);
#   89|   }
#   90|   #define _cleanup_free_ _cleanup_(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def25]
kmod-33-build/kmod-33/shared/util.h:88:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'opt'
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_options'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:825:28: note: in expansion of macro 'streq'
#   86|   /* ************************************************************************ */
#   87|   static inline void freep(void *p) {
#   88|->         free(*(void**) p);
#   89|   }
#   90|   #define _cleanup_free_ _cleanup_(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def26]
kmod-33-build/kmod-33/shared/util.h:88:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'p'
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_blacklist'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:22: included_from: Included from here.
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:964:9: note: in expansion of macro 'kmod_list_foreach'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
kmod-33-build/kmod-33/libkmod/libkmod-internal.h:24:30: note: in expansion of macro 'kmod_log_cond'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:1107:17: note: in expansion of macro 'DBG'
#   86|   /* ************************************************************************ */
#   87|   static inline void freep(void *p) {
#   88|->         free(*(void**) p);
#   89|   }
#   90|   #define _cleanup_free_ _cleanup_(freep)

Error: COMPILER_WARNING (CWE-457): [#def27]
kmod-33-build/kmod-33/shared/util.h:88:9: warning[-Wmaybe-uninitialized]: 'alias' may be used uninitialized
#   88 |         free(*(void**) p);
#      |         ^~~~~~~~~~~~~~~~~
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_new'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:198:43: note: 'alias' was declared here
#  198 |         _cleanup_free_ struct kmod_alias *alias;
#      |                                           ^~~~~
#   86|   /* ************************************************************************ */
#   87|   static inline void freep(void *p) {
#   88|->         free(*(void**) p);
#   89|   }
#   90|   #define _cleanup_free_ _cleanup_(freep)

Error: COMPILER_WARNING (CWE-457): [#def28]
kmod-33-build/kmod-33/shared/util.h:88:9: warning[-Wmaybe-uninitialized]: 'cmd' may be used uninitialized
#   88 |         free(*(void**) p);
#      |         ^~~~~~~~~~~~~~~~~
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_command.isra.0'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:121:45: note: 'cmd' was declared here
#  121 |         _cleanup_free_ struct kmod_command *cmd;
#      |                                             ^~~
#   86|   /* ************************************************************************ */
#   87|   static inline void freep(void *p) {
#   88|->         free(*(void**) p);
#   89|   }
#   90|   #define _cleanup_free_ _cleanup_(freep)

Error: COMPILER_WARNING (CWE-457): [#def29]
kmod-33-build/kmod-33/shared/util.h:88:9: warning[-Wmaybe-uninitialized]: 'line' may be used uninitialized
#   88 |         free(*(void**) p);
#      |         ^~~~~~~~~~~~~~~~~
kmod-33-build/kmod-33/libkmod/libkmod.c: scope_hint: In function 'kmod_lookup_alias_is_builtin'
kmod-33-build/kmod-33/libkmod/libkmod.c:607:30: note: 'line' was declared here
#  607 |         _cleanup_free_ char *line;
#      |                              ^~~~
#   86|   /* ************************************************************************ */
#   87|   static inline void freep(void *p) {
#   88|->         free(*(void**) p);
#   89|   }
#   90|   #define _cleanup_free_ _cleanup_(freep)

Error: COMPILER_WARNING (CWE-457): [#def30]
kmod-33-build/kmod-33/shared/util.h:88:9: warning[-Wmaybe-uninitialized]: 'opt' may be used uninitialized
#   88 |         free(*(void**) p);
#      |         ^~~~~~~~~~~~~~~~~
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_options.isra.0'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:159:45: note: 'opt' was declared here
#  159 |         _cleanup_free_ struct kmod_options *opt;
#      |                                             ^~~
#   86|   /* ************************************************************************ */
#   87|   static inline void freep(void *p) {
#   88|->         free(*(void**) p);
#   89|   }
#   90|   #define _cleanup_free_ _cleanup_(freep)

Error: COMPILER_WARNING (CWE-457): [#def31]
kmod-33-build/kmod-33/shared/util.h:88:9: warning[-Wmaybe-uninitialized]: 'p' may be used uninitialized
#   88 |         free(*(void**) p);
#      |         ^~~~~~~~~~~~~~~~~
kmod-33-build/kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_blacklist.isra.0'
kmod-33-build/kmod-33/libkmod/libkmod-config.c:235:30: note: 'p' was declared here
#  235 |         _cleanup_free_ char *p;
#      |                              ^
#   86|   /* ************************************************************************ */
#   87|   static inline void freep(void *p) {
#   88|->         free(*(void**) p);
#   89|   }
#   90|   #define _cleanup_free_ _cleanup_(freep)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def32]
kmod-33-build/kmod-33/tools/depmod.c: scope_hint: In function ‘index_create’
kmod-33-build/kmod-33/tools/depmod.c:159:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘node’
kmod-33-build/kmod-33/tools/depmod.c:25: included_from: Included from here.
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
#  157|   
#  158|   	node = NOFAIL(calloc(1, sizeof(struct index_node)));
#  159|-> 	node->prefix = NOFAIL(strdup(""));
#  160|   	node->first = INDEX_CHILDMAX;
#  161|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def33]
kmod-33-build/kmod-33/tools/depmod.c: scope_hint: In function ‘index_add_value’
kmod-33-build/kmod-33/tools/depmod.c:222:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘v’
kmod-33-build/kmod-33/tools/depmod.c:29: included_from: Included from here.
kmod-33-build/kmod-33/tools/depmod.c:2207:17: note: in expansion of macro ‘kmod_list_foreach’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
#  220|   	len = strlen(value);
#  221|   	v = NOFAIL(calloc(1, sizeof(struct index_value) + len + 1));
#  222|-> 	v->next = *values;
#  223|   	v->priority = priority;
#  224|   	memcpy(v->value, value, len + 1);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def34]
kmod-33-build/kmod-33/tools/depmod.c: scope_hint: In function ‘index_insert’
kmod-33-build/kmod-33/tools/depmod.c:244:41: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*node.prefix’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
kmod-33-build/kmod-33/tools/depmod.c:2207:17: note: in expansion of macro ‘kmod_list_foreach’
#  242|   		/* Ensure node->prefix is a prefix of &str[i].
#  243|   		   If it is not already, then we must split node. */
#  244|-> 		for (j = 0; node->prefix[j]; j++) {
#  245|   			ch = node->prefix[j];
#  246|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def35]
kmod-33-build/kmod-33/tools/depmod.c:253:33: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘n’ where non-null expected
kmod-33-build/kmod-33/tools/depmod.c:2207:17: note: in expansion of macro ‘kmod_list_foreach’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  251|   				/* New child is copy of node with prefix[j+1..N] */
#  252|   				n = NOFAIL(calloc(1, sizeof(struct index_node)));
#  253|-> 				memcpy(n, node, sizeof(struct index_node));
#  254|   				n->prefix = NOFAIL(strdup(&prefix[j+1]));
#  255|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def36]
kmod-33-build/kmod-33/tools/depmod.c:254:52: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
kmod-33-build/kmod-33/tools/depmod.c:2207:17: note: in expansion of macro ‘kmod_list_foreach’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
kmod-33-build/kmod-33/tools/depmod.c:254:52: note: read of 1 byte from after the end of the region
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
kmod-33-build/kmod-33/tools/depmod.c:17: included_from: Included from here.
/usr/include/string.h:187:14: note: argument 1 of ‘strdup’ must be a pointer to a null-terminated string
#  252|   				n = NOFAIL(calloc(1, sizeof(struct index_node)));
#  253|   				memcpy(n, node, sizeof(struct index_node));
#  254|-> 				n->prefix = NOFAIL(strdup(&prefix[j+1]));
#  255|   
#  256|   				/* Parent has prefix[0..j], child at prefix[j] */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def37]
kmod-33-build/kmod-33/tools/depmod.c:284:39: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(1, 1048)’
kmod-33-build/kmod-33/tools/depmod.c:2207:17: note: in expansion of macro ‘kmod_list_foreach’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
#  282|   
#  283|   			child = node->children[ch];
#  284|-> 			child->prefix = NOFAIL(strdup(&key[i+1]));
#  285|   			child->first = INDEX_CHILDMAX;
#  286|   			index_add_value(&child->values, value, priority);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
kmod-33-build/kmod-33/tools/depmod.c: scope_hint: In function ‘index_write__node’
kmod-33-build/kmod-33/tools/depmod.c:328:39: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘child_offs’
kmod-33-build/kmod-33/tools/depmod.c:2207:17: note: in expansion of macro ‘kmod_list_foreach’
kmod-33-build/kmod-33/tools/depmod.c:8: included_from: Included from here.
/usr/include/arpa/inet.h:22: included_from: Included from here.
kmod-33-build/kmod-33/tools/depmod.c:7: included_from: Included from here.
kmod-33-build/kmod-33/tools/depmod.c: scope_hint: In function ‘index_write__node’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
#  326|   		for (i = 0; i < child_count; i++) {
#  327|   			child = node->children[node->first + i];
#  328|-> 			child_offs[i] = htonl(index_write__node(child, out));
#  329|   		}
#  330|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def39]
kmod-33-build/kmod-33/tools/depmod.c:335:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*node.prefix’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
kmod-33-build/kmod-33/tools/depmod.c: scope_hint: In function ‘index_write__node’
#  333|   	offset = ftell(out);
#  334|   
#  335|-> 	if (node->prefix[0]) {
#  336|   		fputs(node->prefix, out);
#  337|   		fputc('\0', out);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def40]
kmod-33-build/kmod-33/tools/depmod.c:344:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘child_offs’ where non-null expected
kmod-33-build/kmod-33/tools/depmod.c:2207:17: note: in expansion of macro ‘kmod_list_foreach’
kmod-33-build/kmod-33/tools/depmod.c: scope_hint: In function ‘index_write__node’
kmod-33-build/kmod-33/shared/macro.h:43:20: note: in definition of macro ‘NOFAIL’
kmod-33-build/kmod-33/tools/depmod.c:15: included_from: Included from here.
/usr/include/stdio.h:735:15: note: argument 1 of ‘fwrite’ must be non-null
#  342|   		fputc(node->first, out);
#  343|   		fputc(node->last, out);
#  344|-> 		fwrite(child_offs, sizeof(uint32_t), child_count, out);
#  345|   		offset |= INDEX_NODE_CHILDS;
#  346|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
kmod-33-build/kmod-33/tools/depmod.c: scope_hint: In function ‘depmod_modules_search_path’
kmod-33-build/kmod-33/tools/depmod.c:1349:13: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
kmod-33-build/kmod-33/tools/depmod.c:11: included_from: Included from here.
# 1347|   	int err;
# 1348|   
# 1349|-> 	d = opendir(path);
# 1350|   	if (d == NULL) {
# 1351|   		err = -errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
kmod-33-build/kmod-33/tools/depmod.c:1358:13: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
# 1356|   	baselen = strlen(path);
# 1357|   
# 1358|-> 	if (scratchbuf_alloc(&s_path_buf, baselen + 2) < 0) {
# 1359|   		err = -ENOMEM;
# 1360|   		goto out;

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-109.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namekmod-33-1.fc42
store-results-to/tmp/tmpr014m0z7/kmod-33-1.fc42.tar.xz
time-created2024-11-13 01:11:51
time-finished2024-11-13 01:13:16
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpr014m0z7/kmod-33-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpr014m0z7/kmod-33-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9