Task #52208 - fixed.err

back to task #52208
download
Error: GCC_ANALYZER_WARNING (CWE-457):
kmod-33/./shared/util.h:88:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'alias'
kmod-33/libkmod/libkmod-config.c:1046:5: enter_function: entry to 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1054:9: call_function: calling 'conf_files_insert_sorted' from 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1054:9: return_function: returning to 'kmod_config_new' from 'conf_files_insert_sorted'
kmod-33/libkmod/libkmod-config.c:1055:9: call_function: calling 'conf_files_insert_sorted' from 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1055:9: return_function: returning to 'kmod_config_new' from 'conf_files_insert_sorted'
kmod-33/libkmod/libkmod-config.c:1084:12: branch_false: following 'false' branch (when 'config' is non-NULL)...
kmod-33/libkmod/libkmod-config.c:1087:9: branch_false: ...to here
kmod-33/libkmod/libkmod-config.c:1090:16: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1093:35: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1107:17: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1107:17: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1109:20: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1110:25: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1110:25: call_function: calling 'kmod_config_parse' from 'kmod_config_new'
#   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):
kmod-33/./shared/util.h:88:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'cmd'
kmod-33/libkmod/libkmod-config.c:1046:5: enter_function: entry to 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1054:9: call_function: calling 'conf_files_insert_sorted' from 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1054:9: return_function: returning to 'kmod_config_new' from 'conf_files_insert_sorted'
kmod-33/libkmod/libkmod-config.c:1055:9: call_function: calling 'conf_files_insert_sorted' from 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1055:9: return_function: returning to 'kmod_config_new' from 'conf_files_insert_sorted'
kmod-33/libkmod/libkmod-config.c:1084:12: branch_false: following 'false' branch (when 'config' is non-NULL)...
kmod-33/libkmod/libkmod-config.c:1087:9: branch_false: ...to here
kmod-33/libkmod/libkmod-config.c:1090:16: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1093:35: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1107:17: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1107:17: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1109:20: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1110:25: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1110:25: call_function: calling 'kmod_config_parse' from 'kmod_config_new'
#   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):
kmod-33/./shared/util.h:88:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'line'
kmod-33/libkmod/libkmod.c:605:6: enter_function: entry to 'kmod_lookup_alias_is_builtin'
kmod-33/libkmod/libkmod.c:609:16: call_function: calling 'lookup_builtin_file' from 'kmod_lookup_alias_is_builtin'
kmod-33/libkmod/libkmod.c:609:16: return_function: returning to 'kmod_lookup_alias_is_builtin' from 'lookup_builtin_file'
kmod-33/libkmod/libkmod.c:607:30: call_function: inlined call to 'freep' from 'kmod_lookup_alias_is_builtin'
#   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):
kmod-33/./shared/util.h:88:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'opt'
kmod-33/libkmod/libkmod-config.c:1046:5: enter_function: entry to 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1054:9: call_function: calling 'conf_files_insert_sorted' from 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1054:9: return_function: returning to 'kmod_config_new' from 'conf_files_insert_sorted'
kmod-33/libkmod/libkmod-config.c:1055:9: call_function: calling 'conf_files_insert_sorted' from 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1055:9: return_function: returning to 'kmod_config_new' from 'conf_files_insert_sorted'
kmod-33/libkmod/libkmod-config.c:1084:12: branch_false: following 'false' branch (when 'config' is non-NULL)...
kmod-33/libkmod/libkmod-config.c:1087:9: branch_false: ...to here
kmod-33/libkmod/libkmod-config.c:1090:16: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1093:35: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1107:17: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1107:17: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1109:20: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1110:25: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1110:25: call_function: calling 'kmod_config_parse' from 'kmod_config_new'
#   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):
kmod-33/./shared/util.h:88:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'p'
kmod-33/libkmod/libkmod-config.c:1046:5: enter_function: entry to 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1054:9: call_function: calling 'conf_files_insert_sorted' from 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1054:9: return_function: returning to 'kmod_config_new' from 'conf_files_insert_sorted'
kmod-33/libkmod/libkmod-config.c:1055:9: call_function: calling 'conf_files_insert_sorted' from 'kmod_config_new'
kmod-33/libkmod/libkmod-config.c:1055:9: return_function: returning to 'kmod_config_new' from 'conf_files_insert_sorted'
kmod-33/libkmod/libkmod-config.c:1084:12: branch_false: following 'false' branch (when 'config' is non-NULL)...
kmod-33/libkmod/libkmod-config.c:1087:9: branch_false: ...to here
kmod-33/libkmod/libkmod-config.c:1090:16: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1093:35: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1107:17: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1107:17: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1109:20: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-config.c:1110:25: branch_true: ...to here
kmod-33/libkmod/libkmod-config.c:1110:25: call_function: calling 'kmod_config_parse' from 'kmod_config_new'
#   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):
kmod-33/libkmod/libkmod-builtin.c:177:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'line'
kmod-33/libkmod/libkmod-builtin.c:250:9: enter_function: entry to 'kmod_builtin_get_modinfo'
kmod-33/libkmod/libkmod-builtin.c:261:42: call_function: calling 'kmod_builtin_iter_new' from 'kmod_builtin_get_modinfo'
kmod-33/libkmod/libkmod-builtin.c:261:42: return_function: returning to 'kmod_builtin_get_modinfo' from 'kmod_builtin_iter_new'
kmod-33/libkmod/libkmod-builtin.c:263:12: branch_false: following 'false' branch...
<unknown>: branch_false: ...to here
kmod-33/libkmod/libkmod-builtin.c:266:25: call_function: calling 'kmod_builtin_iter_next' from 'kmod_builtin_get_modinfo'
#  175|   		}
#  176|   
#  177|-> 		dot = strchr(line, '.');
#  178|   		if (!dot) {
#  179|   			ERR(iter->ctx, "kmod_builtin_iter_next: unexpected string without modname prefix\n");

Error: GCC_ANALYZER_WARNING (CWE-415):
kmod-33/libkmod/libkmod-builtin.c:200:9: warning[-Wanalyzer-double-free]: double-'free' of 'modname'
kmod-33/libkmod/libkmod-builtin.c:250:9: enter_function: entry to 'kmod_builtin_get_modinfo'
kmod-33/libkmod/libkmod-builtin.c:254:19: release_memory: first 'free' here
kmod-33/libkmod/libkmod-builtin.c:261:42: call_function: calling 'kmod_builtin_iter_new' from 'kmod_builtin_get_modinfo'
kmod-33/libkmod/libkmod-builtin.c:261:42: return_function: returning to 'kmod_builtin_get_modinfo' from 'kmod_builtin_iter_new'
kmod-33/libkmod/libkmod-builtin.c:263:12: branch_false: following 'false' branch...
<unknown>: branch_false: ...to here
kmod-33/libkmod/libkmod-builtin.c:266:25: call_function: calling 'kmod_builtin_iter_next' from 'kmod_builtin_get_modinfo'
#  198|   	iter->next = pos;
#  199|   
#  200|-> 	free(modname);
#  201|   
#  202|   	return (iter->pos < iter->size);

Error: GCC_ANALYZER_WARNING (CWE-688):
kmod-33/libkmod/libkmod-builtin.c:226:15: warning[-Wanalyzer-null-argument]: use of NULL 'line' where non-null expected
kmod-33/libkmod/libkmod-builtin.c:250:9: enter_function: entry to 'kmod_builtin_get_modinfo'
kmod-33/libkmod/libkmod-builtin.c:254:19: release_memory: 'line' is NULL
kmod-33/libkmod/libkmod-builtin.c:261:42: call_function: calling 'kmod_builtin_iter_new' from 'kmod_builtin_get_modinfo'
kmod-33/libkmod/libkmod-builtin.c:261:42: return_function: returning to 'kmod_builtin_get_modinfo' from 'kmod_builtin_iter_new'
kmod-33/libkmod/libkmod-builtin.c:263:12: branch_false: following 'false' branch...
<unknown>: branch_false: ...to here
kmod-33/libkmod/libkmod-builtin.c:266:25: call_function: calling 'kmod_builtin_iter_next' from 'kmod_builtin_get_modinfo'
kmod-33/libkmod/libkmod-builtin.c:266:25: return_function: returning to 'kmod_builtin_get_modinfo' from 'kmod_builtin_iter_next'
kmod-33/libkmod/libkmod-builtin.c:266:16: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-builtin.c:267:22: branch_true: ...to here
kmod-33/libkmod/libkmod-builtin.c:267:22: call_function: calling 'kmod_builtin_iter_get_modname' from 'kmod_builtin_get_modinfo'
#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-476):
kmod-33/libkmod/libkmod-index.c:250:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'node'
kmod-33/libkmod/libkmod-index.c:222:29: enter_function: entry to 'index_read'
kmod-33/libkmod/libkmod-index.c:234:12: branch_false: following 'false' branch...
kmod-33/libkmod/libkmod-index.c:240:26: branch_false: ...to here
kmod-33/libkmod/libkmod-index.c:242:12: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-index.c:243:30: branch_true: ...to here
kmod-33/libkmod/libkmod-index.c:244:29: call_function: calling 'read_char' from 'index_read'
kmod-33/libkmod/libkmod-index.c:244:29: return_function: returning to 'index_read' from 'read_char'
kmod-33/libkmod/libkmod-index.c:247:24: acquire_memory: this call could return NULL
kmod-33/libkmod/libkmod-index.c:250:17: danger: 'node' could be NULL: unchecked value from [(12)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/11)
#  248|   				     sizeof(uint32_t) * child_count));
#  249|   
#  250|-> 		node->first = first;
#  251|   		node->last = last;
#  252|   

Error: GCC_ANALYZER_WARNING (CWE-476):
kmod-33/libkmod/libkmod-index.c:257:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'node'
kmod-33/libkmod/libkmod-index.c:234:12: branch_false: following 'false' branch...
kmod-33/libkmod/libkmod-index.c:240:26: branch_false: ...to here
kmod-33/libkmod/libkmod-index.c:242:12: branch_false: following 'false' branch...
kmod-33/libkmod/libkmod-index.c:256:24: branch_false: ...to here
kmod-33/libkmod/libkmod-index.c:256:24: acquire_memory: this call could return NULL
kmod-33/libkmod/libkmod-index.c:257:17: danger: 'node' could be NULL: unchecked value from [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  255|   	} else {
#  256|   		node = NOFAIL(malloc(sizeof(struct index_node_f)));
#  257|-> 		node->first = INDEX_CHILDMAX;
#  258|   		node->last = 0;
#  259|   	}

Error: GCC_ANALYZER_WARNING (CWE-688):
kmod-33/libkmod/libkmod-module.c:184:24: warning[-Wanalyzer-null-argument]: use of NULL 'depmod' where non-null expected
kmod-33/libkmod/libkmod-module.c:2281:25: enter_function: entry to 'kmod_module_get_elf'
kmod-33/libkmod/libkmod-module.c:2283:12: branch_true: following 'true' branch...
kmod-33/libkmod/libkmod-module.c:2284:36: branch_true: ...to here
kmod-33/libkmod/libkmod-module.c:2284:36: call_function: calling 'kmod_module_get_path' from 'kmod_module_get_elf'
#  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):
kmod-33/libkmod/libkmod-module.c:2194:27: warning[-Wanalyzer-malloc-leak]: leak of 'section'
kmod-33/libkmod/libkmod-module.c:2151:12: branch_false: following 'false' branch (when 'mod' is non-NULL)...
kmod-33/libkmod/libkmod-module.c:2154:67: branch_false: ...to here
kmod-33/libkmod/libkmod-module.c:2157:12: branch_false: following 'false' branch...
kmod-33/libkmod/libkmod-module.c:2163:15: branch_false: ...to here
kmod-33/libkmod/libkmod-module.c:2165:33: branch_true: following 'true' branch (when 'dent' is non-NULL)...
kmod-33/libkmod/libkmod-module.c:2172:21: branch_true: ...to here
kmod-33/libkmod/libkmod-module.c:2179:20: branch_false: following 'false' branch...
kmod-33/libkmod/libkmod-module.c:2185:23: branch_false: ...to here
kmod-33/libkmod/libkmod-module.c:2187:20: branch_false: following 'false' branch...
kmod-33/libkmod/libkmod-module.c:2193:26: branch_false: ...to here
kmod-33/libkmod/libkmod-module.c:2194:27: acquire_memory: allocated here
kmod-33/libkmod/libkmod-module.c:2196:20: branch_false: following 'false' branch (when 'section' is non-NULL)...
kmod-33/libkmod/libkmod-module.c:2201:17: branch_false: ...to here
kmod-33/libkmod/libkmod-module.c:2205:20: branch_true: following 'true' branch...
<unknown>: branch_true: ...to here
kmod-33/libkmod/libkmod-module.c:2165:33: branch_true: following 'true' branch (when 'dent' is non-NULL)...
kmod-33/libkmod/libkmod-module.c:2172:21: branch_true: ...to here
kmod-33/libkmod/libkmod-module.c:2179:20: branch_false: following 'false' branch...
kmod-33/libkmod/libkmod-module.c:2185:23: branch_false: ...to here
kmod-33/libkmod/libkmod-module.c:2187:20: branch_false: following 'false' branch...
kmod-33/libkmod/libkmod-module.c:2193:26: branch_false: ...to here
kmod-33/libkmod/libkmod-module.c:2194:27: danger: 'section' leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
# 2192|   
# 2193|   		namesz = strlen(dent->d_name) + 1;
# 2194|-> 		section = malloc(sizeof(*section) + namesz);
# 2195|   
# 2196|   		if (section == NULL) {

Error: COMPILER_WARNING (CWE-457):
kmod-33/shared/util.h:88:9: warning[-Wmaybe-uninitialized]: 'alias' may be used uninitialized
#   88 |         free(*(void**) p);
#      |         ^~~~~~~~~~~~~~~~~
kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_new'
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):
kmod-33/shared/util.h:88:9: warning[-Wmaybe-uninitialized]: 'cmd' may be used uninitialized
#   88 |         free(*(void**) p);
#      |         ^~~~~~~~~~~~~~~~~
kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_command.isra.0'
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):
kmod-33/shared/util.h:88:9: warning[-Wmaybe-uninitialized]: 'line' may be used uninitialized
#   88 |         free(*(void**) p);
#      |         ^~~~~~~~~~~~~~~~~
kmod-33/libkmod/libkmod.c: scope_hint: In function 'kmod_lookup_alias_is_builtin'
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):
kmod-33/shared/util.h:88:9: warning[-Wmaybe-uninitialized]: 'opt' may be used uninitialized
#   88 |         free(*(void**) p);
#      |         ^~~~~~~~~~~~~~~~~
kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_options.isra.0'
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):
kmod-33/shared/util.h:88:9: warning[-Wmaybe-uninitialized]: 'p' may be used uninitialized
#   88 |         free(*(void**) p);
#      |         ^~~~~~~~~~~~~~~~~
kmod-33/libkmod/libkmod-config.c: scope_hint: In function 'kmod_config_add_blacklist.isra.0'
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):
kmod-33/tools/depmod.c:159:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘node’
kmod-33/tools/depmod.c:2095:12: enter_function: entry to ‘output_deps_bin’
kmod-33/tools/depmod.c:2103:15: call_function: calling ‘index_create’ from ‘output_deps_bin’
#  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):
kmod-33/tools/depmod.c:222:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘v’
kmod-33/tools/depmod.c:2191:12: enter_function: entry to ‘output_aliases_bin’
kmod-33/tools/depmod.c:2203:21: branch_true: following ‘true’ branch...
kmod-33/tools/depmod.c:2204:41: branch_true: ...to here
kmod-33/tools/depmod.c:2207:17: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)...
kmod-33/tools/depmod.c:2208:43: branch_true: ...to here
kmod-33/tools/depmod.c:2214:28: branch_false: following ‘false’ branch (when the strings are equal)...
kmod-33/tools/depmod.c:2217:29: branch_false: ...to here
kmod-33/tools/depmod.c:2217:28: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:2224:50: branch_false: ...to here
kmod-33/tools/depmod.c:2223:37: call_function: calling ‘index_insert’ from ‘output_aliases_bin’
#  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):
kmod-33/tools/depmod.c:244:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*node.prefix’
kmod-33/tools/depmod.c:2191:12: enter_function: entry to ‘output_aliases_bin’
kmod-33/tools/depmod.c:2199:15: call_function: calling ‘index_create’ from ‘output_aliases_bin’
kmod-33/tools/depmod.c:2199:15: return_function: returning to ‘output_aliases_bin’ from ‘index_create’
kmod-33/tools/depmod.c:2203:21: branch_true: following ‘true’ branch...
kmod-33/tools/depmod.c:2204:41: branch_true: ...to here
kmod-33/tools/depmod.c:2207:17: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)...
kmod-33/tools/depmod.c:2208:43: branch_true: ...to here
kmod-33/tools/depmod.c:2214:28: branch_false: following ‘false’ branch (when the strings are equal)...
kmod-33/tools/depmod.c:2217:29: branch_false: ...to here
kmod-33/tools/depmod.c:2217:28: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:2224:50: branch_false: ...to here
kmod-33/tools/depmod.c:2223:37: call_function: calling ‘index_insert’ from ‘output_aliases_bin’
#  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):
kmod-33/tools/depmod.c:253:33: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘n’ where non-null expected
kmod-33/tools/depmod.c:2191:12: enter_function: entry to ‘output_aliases_bin’
kmod-33/tools/depmod.c:2203:21: branch_true: following ‘true’ branch...
kmod-33/tools/depmod.c:2204:41: branch_true: ...to here
kmod-33/tools/depmod.c:2207:17: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)...
kmod-33/tools/depmod.c:2208:43: branch_true: ...to here
kmod-33/tools/depmod.c:2214:28: branch_false: following ‘false’ branch (when the strings are equal)...
kmod-33/tools/depmod.c:2217:29: branch_false: ...to here
kmod-33/tools/depmod.c:2217:28: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:2224:50: branch_false: ...to here
kmod-33/tools/depmod.c:2223:37: call_function: calling ‘index_insert’ from ‘output_aliases_bin’
#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):
kmod-33/tools/depmod.c:254:45: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
kmod-33/tools/depmod.c:2191:12: enter_function: entry to ‘output_aliases_bin’
kmod-33/tools/depmod.c:2199:15: call_function: calling ‘index_create’ from ‘output_aliases_bin’
kmod-33/tools/depmod.c:2199:15: return_function: returning to ‘output_aliases_bin’ from ‘index_create’
kmod-33/tools/depmod.c:2203:21: branch_true: following ‘true’ branch...
kmod-33/tools/depmod.c:2204:41: branch_true: ...to here
kmod-33/tools/depmod.c:2207:17: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)...
kmod-33/tools/depmod.c:2208:43: branch_true: ...to here
kmod-33/tools/depmod.c:2214:28: branch_false: following ‘false’ branch (when the strings are equal)...
kmod-33/tools/depmod.c:2217:29: branch_false: ...to here
kmod-33/tools/depmod.c:2217:28: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:2224:50: branch_false: ...to here
kmod-33/tools/depmod.c:2223:37: call_function: calling ‘index_insert’ from ‘output_aliases_bin’
#  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):
kmod-33/tools/depmod.c:284:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(1, 1048)’
kmod-33/tools/depmod.c:2191:12: enter_function: entry to ‘output_aliases_bin’
kmod-33/tools/depmod.c:2203:21: branch_true: following ‘true’ branch...
kmod-33/tools/depmod.c:2204:41: branch_true: ...to here
kmod-33/tools/depmod.c:2207:17: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)...
kmod-33/tools/depmod.c:2208:43: branch_true: ...to here
kmod-33/tools/depmod.c:2214:28: branch_false: following ‘false’ branch (when the strings are equal)...
kmod-33/tools/depmod.c:2217:29: branch_false: ...to here
kmod-33/tools/depmod.c:2217:28: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:2224:50: branch_false: ...to here
kmod-33/tools/depmod.c:2223:37: call_function: calling ‘index_insert’ from ‘output_aliases_bin’
#  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):
kmod-33/tools/depmod.c:328:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘child_offs’
kmod-33/tools/depmod.c:2191:12: enter_function: entry to ‘output_aliases_bin’
kmod-33/tools/depmod.c:2203:21: branch_true: following ‘true’ branch...
kmod-33/tools/depmod.c:2204:41: branch_true: ...to here
kmod-33/tools/depmod.c:2207:17: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)...
kmod-33/tools/depmod.c:2208:43: branch_true: ...to here
kmod-33/tools/depmod.c:2214:28: branch_false: following ‘false’ branch (when the strings are equal)...
kmod-33/tools/depmod.c:2217:29: branch_false: ...to here
kmod-33/tools/depmod.c:2217:28: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:2224:50: branch_false: ...to here
kmod-33/tools/depmod.c:2223:37: call_function: calling ‘index_insert’ from ‘output_aliases_bin’
kmod-33/tools/depmod.c:2223:37: return_function: returning to ‘output_aliases_bin’ from ‘index_insert’
kmod-33/tools/depmod.c:2203:21: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:2231:9: branch_false: ...to here
kmod-33/tools/depmod.c:2231:9: call_function: calling ‘index_write’ from ‘output_aliases_bin’
#  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):
kmod-33/tools/depmod.c:335:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*node.prefix’
kmod-33/tools/depmod.c:2095:12: enter_function: entry to ‘output_deps_bin’
kmod-33/tools/depmod.c:2103:15: call_function: calling ‘index_create’ from ‘output_deps_bin’
kmod-33/tools/depmod.c:2103:15: return_function: returning to ‘output_deps_bin’ from ‘index_create’
kmod-33/tools/depmod.c:2161:9: call_function: calling ‘index_write’ from ‘output_deps_bin’
#  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):
kmod-33/tools/depmod.c:344:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘child_offs’ where non-null expected
kmod-33/tools/depmod.c:2191:12: enter_function: entry to ‘output_aliases_bin’
kmod-33/tools/depmod.c:2203:21: branch_true: following ‘true’ branch...
kmod-33/tools/depmod.c:2204:41: branch_true: ...to here
kmod-33/tools/depmod.c:2207:17: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)...
kmod-33/tools/depmod.c:2208:43: branch_true: ...to here
kmod-33/tools/depmod.c:2214:28: branch_false: following ‘false’ branch (when the strings are equal)...
kmod-33/tools/depmod.c:2217:29: branch_false: ...to here
kmod-33/tools/depmod.c:2217:28: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:2224:50: branch_false: ...to here
kmod-33/tools/depmod.c:2223:37: call_function: calling ‘index_insert’ from ‘output_aliases_bin’
kmod-33/tools/depmod.c:2223:37: return_function: returning to ‘output_aliases_bin’ from ‘index_insert’
kmod-33/tools/depmod.c:2203:21: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:2231:9: branch_false: ...to here
kmod-33/tools/depmod.c:2231:9: call_function: calling ‘index_write’ from ‘output_aliases_bin’
#  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):
kmod-33/tools/depmod.c:1358:13: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
kmod-33/tools/depmod.c:2893:12: enter_function: entry to ‘do_depmod’
kmod-33/tools/depmod.c:2914:20: branch_false: following ‘false’ branch (when ‘c != -1’)...
kmod-33/tools/depmod.c:2916:17: branch_false: ...to here
kmod-33/tools/depmod.c:2929:28: branch_false: following ‘false’ branch (when ‘out_root’ is NULL)...
kmod-33/tools/depmod.c:2931:36: branch_false: ...to here
kmod-33/tools/depmod.c:3006:20: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:3010:17: branch_false: ...to here
kmod-33/tools/depmod.c:3013:26: branch_false: following ‘false’ branch (when ‘root’ is NULL)...
<unknown>: branch_false: ...to here
kmod-33/tools/depmod.c:3034:12: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:3039:9: branch_false: ...to here
kmod-33/tools/depmod.c:3041:15: call_function: calling ‘depmod_init’ from ‘do_depmod’
kmod-33/tools/depmod.c:3041:15: return_function: returning to ‘do_depmod’ from ‘depmod_init’
kmod-33/tools/depmod.c:3042:12: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:3048:12: branch_false: ...to here
kmod-33/tools/depmod.c:3048:12: branch_false: following ‘false’ branch (when ‘module_symvers’ is NULL)...
kmod-33/tools/depmod.c:3055:19: branch_false: ...to here
kmod-33/tools/depmod.c:3055:19: branch_false: following ‘false’ branch (when ‘system_map’ is NULL)...
kmod-33/tools/depmod.c:3062:20: branch_false: ...to here
kmod-33/tools/depmod.c:3062:19: branch_false: following ‘false’ branch...
kmod-33/tools/depmod.c:3067:12: branch_false: ...to here
kmod-33/tools/depmod.c:3067:12: branch_true: following ‘true’ branch (when ‘all != 0’)...
kmod-33/tools/depmod.c:3068:23: branch_true: ...to here
kmod-33/tools/depmod.c:3068:23: call_function: calling ‘cfg_load’ from ‘do_depmod’
kmod-33/tools/depmod.c:3068:23: return_function: returning to ‘do_depmod’ from ‘cfg_load’
kmod-33/tools/depmod.c:3073:23: call_function: calling ‘depmod_modules_search’ from ‘do_depmod’
# 1356|   	baselen = strlen(path);
# 1357|   
# 1358|-> 	if (scratchbuf_alloc(&s_path_buf, baselen + 2) < 0) {
# 1359|   		err = -ENOMEM;
# 1360|   		goto out;