kexec-tools-2.0.32-1.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:732:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/sys/kernel/crash_notes", "r")’
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:727:14: acquire_resource: opened here
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:728:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:729:21: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:729:20: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:730:33: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:731:28: branch_true: following ‘true’ branch (when ‘count != 1’)...
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:733:58: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:732:33: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:732:33: danger: ‘fopen("/sys/kernel/crash_notes", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  730|   			count = sscanf(line, "%lx", &vaddr);
#  731|   			if (count != 1)
#  732|-> 				die("Cannot parse %s: %s\n", crash_notes,
#  733|   						strerror(errno));
#  734|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:732:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/sys/kernel/crash_notes", "r")’
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:727:14: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:728:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:729:21: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:729:20: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:730:33: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:731:28: branch_true: following ‘true’ branch (when ‘count != 1’)...
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:733:58: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:732:33: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:732:33: danger: ‘fopen("/sys/kernel/crash_notes", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  730|   			count = sscanf(line, "%lx", &vaddr);
#  731|   			if (count != 1)
#  732|-> 				die("Cannot parse %s: %s\n", crash_notes,
#  733|   						strerror(errno));
#  734|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:773:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/firmware/efi/runtime-map")’
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:769:15: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:770:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:773:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:773:9: danger: ‘opendir("/sys/firmware/efi/runtime-map")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  771|   		return 0;
#  772|   
#  773|-> 	closedir(dir);
#  774|   	return 1;
#  775|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def4]
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:870:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘mem_range’
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:860:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:870:9: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/crashdump-x86.c:870:9: danger: use of uninitialized value ‘mem_range’ here
#  868|   			return -1;
#  869|   
#  870|-> 	get_backup_area(info, mem_range, nr_ranges);
#  871|   
#  872|   	dbgprint_mem_range("CRASH MEMORY RANGES", mem_range, nr_ranges);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:461:31: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:424:15: branch_true: following ‘true’ branch (when ‘opt != -1’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:425:17: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:449:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:453:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:453:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:456:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:456:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:460:12: branch_true: following ‘true’ branch (when ‘ramdisk’ is non-NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:461:31: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:461:31: throw: if ‘slurp_file’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:461:31: danger: ‘command_line’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  459|   	ramdisk_buf = 0;
#  460|   	if (ramdisk) {
#  461|-> 		ramdisk_buf = slurp_file(ramdisk, &ramdisk_length);
#  462|   	}
#  463|   	dtb_buf = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:465:27: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:424:15: branch_true: following ‘true’ branch (when ‘opt != -1’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:425:17: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:449:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:453:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:453:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:456:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:456:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:460:12: branch_false: following ‘false’ branch (when ‘ramdisk’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:464:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:464:12: branch_true: following ‘true’ branch (when ‘dtb’ is non-NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:465:27: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:465:27: throw: if ‘slurp_file’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-bzImage.c:465:27: danger: ‘command_line’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  463|   	dtb_buf = 0;
#  464|   	if (dtb) {
#  465|-> 		dtb_buf = slurp_file(dtb, &dtb_length);
#  466|   	}
#  467|   	result = do_bzImage_load(info,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:204:36: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:204:36: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:204:36: throw: if ‘xmalloc’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:204:36: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  202|   	 */
#  203|   	if (info->kexec_flags & (KEXEC_ON_CRASH|KEXEC_PRESERVE_CONTEXT)) {
#  204|-> 		modified_cmdline = xmalloc(COMMAND_LINE_SIZE);
#  205|   		memset((void *)modified_cmdline, 0, COMMAND_LINE_SIZE);
#  206|   		if (command_line) {

Error: GCC_ANALYZER_WARNING (CWE-126): [#def8]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:207:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:204:36: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:206:20: branch_true: following ‘true’ branch (when ‘command_line’ is non-NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:207:25: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:207:25: danger: out-of-bounds read from byte 1 till byte 2047 but region ends at byte 1
#  205|   		memset((void *)modified_cmdline, 0, COMMAND_LINE_SIZE);
#  206|   		if (command_line) {
#  207|-> 			strncpy(modified_cmdline, command_line,
#  208|   						COMMAND_LINE_SIZE);
#  209|   			modified_cmdline[COMMAND_LINE_SIZE - 1] = '\0';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: throw: if ‘elf_exec_build_load’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  212|   
#  213|   	/* Load the ELF executable */
#  214|-> 	elf_exec_build_load(info, &ehdr, buf, len, 0);
#  215|   
#  216|   	entry = ehdr.e_entry;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:217:20: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:217:20: throw: if ‘elf_max_addr’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:217:20: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  215|   
#  216|   	entry = ehdr.e_entry;
#  217|-> 	max_addr = elf_max_addr(&ehdr);
#  218|   
#  219|   	/* Do we want arguments? */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:222:17: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:222:17: throw: if ‘elf_rel_build_load’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:222:17: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  220|   	if (arg_style != ARG_STYLE_NONE) {
#  221|   		/* Load the setup code */
#  222|-> 		elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size,
#  223|   			0, ULONG_MAX, 1, 0);
#  224|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:235:29: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_true: following ‘true’ branch (when ‘arg_style == 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:235:29: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:235:29: throw: if ‘elf_boot_notes’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:235:29: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  233|   
#  234|   		/* Setup the ELF boot notes */
#  235|-> 		note_base = elf_boot_notes(info, max_addr,
#  236|   					   command_line, command_line_len);
#  237|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:241:17: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_true: following ‘true’ branch (when ‘arg_style == 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:235:29: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:241:17: throw: if ‘elf_rel_set_symbol’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:241:17: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  239|   		arg2 = 0; /* No return address */
#  240|   		arg1 = note_base;
#  241|-> 		elf_rel_set_symbol(&info->rhdr, "stack_arg32_1", &arg1, sizeof(arg1));
#  242|   		elf_rel_set_symbol(&info->rhdr, "stack_arg32_2", &arg2, sizeof(arg2));
#  243|   		

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:242:17: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_true: following ‘true’ branch (when ‘arg_style == 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:235:29: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:242:17: throw: if ‘elf_rel_set_symbol’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:242:17: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  240|   		arg1 = note_base;
#  241|   		elf_rel_set_symbol(&info->rhdr, "stack_arg32_1", &arg1, sizeof(arg1));
#  242|-> 		elf_rel_set_symbol(&info->rhdr, "stack_arg32_2", &arg2, sizeof(arg2));
#  243|   		
#  244|   		/* Initialize the registers */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:245:17: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_true: following ‘true’ branch (when ‘arg_style == 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:235:29: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:245:17: throw: if ‘elf_rel_get_symbol’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:245:17: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  243|   		
#  244|   		/* Initialize the registers */
#  245|-> 		elf_rel_get_symbol(&info->rhdr, "entry32_regs", &regs, sizeof(regs));
#  246|   		regs.eip = entry;       /* The entry point */
#  247|   		regs.esp = elf_rel_get_addr(&info->rhdr, "stack_arg32_2");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:247:28: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_true: following ‘true’ branch (when ‘arg_style == 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:235:29: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:247:28: throw: if ‘elf_rel_get_addr’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:247:28: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
#  245|   		elf_rel_get_symbol(&info->rhdr, "entry32_regs", &regs, sizeof(regs));
#  246|   		regs.eip = entry;       /* The entry point */
#  247|-> 		regs.esp = elf_rel_get_addr(&info->rhdr, "stack_arg32_2");
#  248|   		elf_rel_set_symbol(&info->rhdr, "entry32_regs", &regs, sizeof(regs));
#  249|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:248:17: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_true: following ‘true’ branch (when ‘arg_style == 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:235:29: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:248:17: throw: if ‘elf_rel_set_symbol’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:248:17: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
#  246|   		regs.eip = entry;       /* The entry point */
#  247|   		regs.esp = elf_rel_get_addr(&info->rhdr, "stack_arg32_2");
#  248|-> 		elf_rel_set_symbol(&info->rhdr, "entry32_regs", &regs, sizeof(regs));
#  249|   
#  250|   		if (ramdisk) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: throw: if ‘xmalloc’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
#  262|   
#  263|   		/* Get the linux parameter header */
#  264|-> 		hdr = xmalloc(sizeof(*hdr));
#  265|   
#  266|   		/* Hack: With some ld versions, vmlinux program headers show

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:274:30: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:274:30: throw: if ‘add_buffer’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:274:30: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
#  272|   		 * This is a makeshift solution until it is fixed in kernel
#  273|   		 */
#  274|-> 		param_base = add_buffer(info, hdr, sizeof(*hdr), 16*1024,
#  275|   			16, 0, max_addr, 1);
#  276|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:279:17: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:279:17: throw: if ‘init_linux_parameters’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:279:17: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
#  277|   		/* Initialize the parameter header */
#  278|   		memset(hdr, 0, sizeof(*hdr));
#  279|-> 		init_linux_parameters(&hdr->hdr);
#  280|   
#  281|   		/* Add a ramdisk to the current image */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:291:30: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:284:20: branch_false: following ‘false’ branch (when ‘ramdisk’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:21: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:20: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:291:30: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:291:30: throw: if ‘load_crashdump_segments’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:291:30: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
#  289|   		 * to be created. */
#  290|   		if (info->kexec_flags & (KEXEC_ON_CRASH|KEXEC_PRESERVE_CONTEXT)) {
#  291|-> 			rc = load_crashdump_segments(info, modified_cmdline,
#  292|   						max_addr, 0);
#  293|   			if (rc < 0) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def22]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:300:44: warning[-Wanalyzer-null-argument]: use of NULL ‘modified_cmdline’ where non-null expected
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:284:20: branch_false: following ‘false’ branch (when ‘ramdisk’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:21: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:20: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:291:30: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:293:28: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:298:25: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:300:44: danger: argument 1 (‘modified_cmdline’) NULL where non-null expected
#  298|   			free(command_line);
#  299|   			command_line = modified_cmdline;
#  300|-> 			command_line_len = strlen(modified_cmdline) + 1;
#  301|   			modified_cmdline = NULL;
#  302|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:311:17: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:284:20: branch_false: following ‘false’ branch (when ‘ramdisk’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:21: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:20: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:305:17: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:311:17: throw: if ‘setup_linux_system_parameters’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:311:17: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
#  309|   
#  310|   		/* Fill in the information bios calls would usually provide */
#  311|-> 		setup_linux_system_parameters(info, &hdr->hdr);
#  312|   
#  313|   		/* Initialize the registers */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:314:17: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:284:20: branch_false: following ‘false’ branch (when ‘ramdisk’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:21: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:20: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:305:17: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:314:17: throw: if ‘elf_rel_get_symbol’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:314:17: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
#  312|   
#  313|   		/* Initialize the registers */
#  314|-> 		elf_rel_get_symbol(&info->rhdr, "entry32_regs", &regs, sizeof(regs));
#  315|   		regs.ebx = 0;		/* Bootstrap processor */
#  316|   		regs.esi = param_base;	/* Pointer to the parameters */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:318:28: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:284:20: branch_false: following ‘false’ branch (when ‘ramdisk’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:21: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:20: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:305:17: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:318:28: throw: if ‘elf_rel_get_addr’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:318:28: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/4)
#  316|   		regs.esi = param_base;	/* Pointer to the parameters */
#  317|   		regs.eip = entry;	/* The entry point */
#  318|-> 		regs.esp = elf_rel_get_addr(&info->rhdr, "stack_end"); /* Stack, unused */
#  319|   		elf_rel_set_symbol(&info->rhdr, "entry32_regs", &regs, sizeof(regs));
#  320|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:319:17: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:284:20: branch_false: following ‘false’ branch (when ‘ramdisk’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:21: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:20: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:305:17: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:319:17: throw: if ‘elf_rel_set_symbol’ throws an exception...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:319:17: danger: ‘command_line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/4)
#  317|   		regs.eip = entry;	/* The entry point */
#  318|   		regs.esp = elf_rel_get_addr(&info->rhdr, "stack_end"); /* Stack, unused */
#  319|-> 		elf_rel_set_symbol(&info->rhdr, "entry32_regs", &regs, sizeof(regs));
#  320|   	}
#  321|   	else {

Error: COMPILER_WARNING: [#def27]
kexec-tools-2.0.32/kexec/arch/i386/kexec-mb2-x86.c: scope_hint: In function ‘multiboot2_x86_load’
kexec-tools-2.0.32/kexec/arch/i386/kexec-mb2-x86.c:562:21: warning[-Wunused-but-set-variable=]: variable ‘i’ set but not used
#  562 |                 int i = 0;
#      |                     ^
#  560|   		char *mod_filename, *mod_command_line, *mod_clp, *buf;
#  561|   		off_t mod_size;
#  562|-> 		int i = 0;
#  563|   
#  564|   		mod_clp_base = xmalloc(mod_command_line_space);

Error: COMPILER_WARNING (CWE-252): [#def28]
kexec-tools-2.0.32/kexec/arch/i386/kexec-x86-common.c: scope_hint: In function ‘efi_map_added’
kexec-tools-2.0.32/kexec/arch/i386/kexec-x86-common.c:320:17: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#  320 |                 fgets( buf, 512, fp );
#      |                 ^~~~~~~~~~~~~~~~~~~~~
#  318|   	FILE *fp = fopen( "/proc/cmdline", "r" );
#  319|   	if( fp ) {
#  320|-> 		fgets( buf, 512, fp );
#  321|   		fclose( fp );
#  322|   		return strstr( buf, "add_efi_memmap" ) != NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:403:16: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/firmware/edd")’
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:891:6: enter_function: entry to ‘setup_linux_system_parameters’
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:897:9: call_function: inlined call to ‘setup_subarch’ from ‘setup_linux_system_parameters’
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:897:9: call_function: inlined call to ‘setup_subarch’ from ‘setup_linux_system_parameters’
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:913:15: call_function: calling ‘setup_linux_vesafb’ from ‘setup_linux_system_parameters’
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:913:15: return_function: returning to ‘setup_linux_system_parameters’ from ‘setup_linux_vesafb’
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:914:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:918:17: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:921:23: call_function: calling ‘get_bootparam’ from ‘setup_linux_system_parameters’
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:921:23: return_function: returning to ‘setup_linux_system_parameters’ from ‘get_bootparam’
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:922:20: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:928:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:950:9: call_function: calling ‘setup_e820’ from ‘setup_linux_system_parameters’
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:950:9: return_function: returning to ‘setup_linux_system_parameters’ from ‘setup_e820’
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:956:9: call_function: calling ‘setup_edd_info’ from ‘setup_linux_system_parameters’
#  401|   	real_mode->eddbuf_entries = 0;
#  402|   	real_mode->edd_mbr_sig_buf_entries = 0;
#  403|-> 	memset(real_mode->eddbuf, 0,
#  404|   		EDDMAXNR * sizeof(struct edd_info));
#  405|   	memset(real_mode->edd_mbr_sig_buffer, 0,

Error: COMPILER_WARNING (CWE-252): [#def30]
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c: scope_hint: In function ‘get_bootparam’
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.c:514:9: warning[-Wunused-result]: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
#  514 |         read(data_file, buf, size);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
#  512|   	if (lseek(data_file, offset, SEEK_SET) < 0)
#  513|   		goto close;
#  514|-> 	read(data_file, buf, size);
#  515|   close:
#  516|   	close(data_file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
kexec-tools-2.0.32/kexec/arch/i386/x86-linux-setup.h:17:9: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:117:5: enter_function: entry to ‘elf_x86_load’
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:189:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:193:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:196:28: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:203:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:214:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:229:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:264:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:284:20: branch_false: following ‘false’ branch (when ‘ramdisk’ is NULL)...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:21: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:290:20: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:305:17: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/i386/kexec-elf-x86.c:305:17: call_function: inlined call to ‘setup_linux_bootloader_parameters’ from ‘elf_x86_load’
#   15|   	const char *initrd_buf, off_t initrd_size)
#   16|   {
#   17|-> 	setup_linux_bootloader_parameters_high(info,
#   18|   			real_mode, real_mode_base,
#   19|   			cmdline_offset, cmdline, cmdline_len,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:311:35: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:269:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:270:17: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:293:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:296:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:296:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:299:32: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:299:32: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:303:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:310:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:310:12: branch_true: following ‘true’ branch (when ‘ramdisk’ is non-NULL)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:311:35: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:311:35: throw: if ‘open’ throws an exception...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:311:35: danger: ‘command_line’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  309|   
#  310|   	if (ramdisk) {
#  311|-> 		info->initrd_fd = open(ramdisk, O_RDONLY);
#  312|   		if (info->initrd_fd == -1) {
#  313|   			fprintf(stderr, "Could not open initrd file %s:%s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:393:31: warning[-Wanalyzer-malloc-leak]: leak of ‘command_line’
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:341:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:341:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:358:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:359:17: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:382:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:385:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:385:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:388:32: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:388:32: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:392:12: branch_true: following ‘true’ branch (when ‘ramdisk’ is non-NULL)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:393:31: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:393:31: throw: if ‘slurp_file’ throws an exception...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-bzImage64.c:393:31: danger: ‘command_line’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  391|   	ramdisk_buf = 0;
#  392|   	if (ramdisk)
#  393|-> 		ramdisk_buf = slurp_file(ramdisk, &ramdisk_length);
#  394|   
#  395|   	if (entry_16bit || entry_32bit)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def34]
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:226:44: warning[-Wanalyzer-null-argument]: use of NULL ‘modified_cmdline’ where non-null expected
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:135:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:138:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:145:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:156:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:162:12: branch_true: following ‘true’ branch (when ‘arg_style != 2’)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:164:17: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:171:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:199:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:210:20: branch_false: following ‘false’ branch (when ‘ramdisk’ is NULL)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:216:21: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:216:20: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:217:30: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:219:28: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:224:25: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:226:44: danger: argument 1 (‘modified_cmdline’) NULL where non-null expected
#  224|   			free(command_line);
#  225|   			command_line = modified_cmdline;
#  226|-> 			command_line_len = strlen(modified_cmdline) + 1;
#  227|   			modified_cmdline = NULL;
#  228|   		}

Error: GCC_ANALYZER_WARNING (CWE-415): [#def35]
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:253:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘modified_cmdline’
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:135:12: branch_false: following ‘false’ branch (when ‘tmp_cmdline’ is NULL)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:138:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:145:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:146:36: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:148:20: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:156:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:162:12: branch_true: following ‘true’ branch (when ‘arg_style != 2’)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:164:17: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:171:17: branch_false: following ‘false’ branch (when ‘arg_style != 0’)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:199:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:210:20: branch_false: following ‘false’ branch (when ‘ramdisk’ is NULL)...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:216:21: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:216:20: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:217:30: branch_true: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:219:28: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:224:25: branch_false: ...to here
kexec-tools-2.0.32/kexec/arch/x86_64/kexec-elf-x86_64.c:253:9: danger: second ‘free’ here
#  251|   out:
#  252|   	free(command_line);
#  253|-> 	free(modified_cmdline);
#  254|   	if (error_msg)
#  255|   		die("%s", error_msg);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
kexec-tools-2.0.32/kexec/crashdump.c:100:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&crash_notes, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:81:14: acquire_resource: opened here
kexec-tools-2.0.32/kexec/crashdump.c:82:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:99:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:99:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:100:68: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:100:17: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:100:17: danger: ‘fopen(&crash_notes, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   98|   	}
#   99|   	if (!fgets(line, sizeof(line), fp))
#  100|-> 		die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
#  101|   	count = sscanf(line, "%llx", &temp);
#  102|   	if (count != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
kexec-tools-2.0.32/kexec/crashdump.c:100:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&crash_notes, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:81:14: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/crashdump.c:82:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:99:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:99:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:100:68: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:100:17: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:100:17: danger: ‘fopen(&crash_notes, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   98|   	}
#   99|   	if (!fgets(line, sizeof(line), fp))
#  100|-> 		die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
#  101|   	count = sscanf(line, "%llx", &temp);
#  102|   	if (count != 1)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def38]
kexec-tools-2.0.32/kexec/crashdump.c:103:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&crash_notes, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:81:14: acquire_resource: opened here
kexec-tools-2.0.32/kexec/crashdump.c:82:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:99:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:102:12: branch_true: following ‘true’ branch (when ‘count != 1’)...
kexec-tools-2.0.32/kexec/crashdump.c:103:68: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:103:17: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:103:17: danger: ‘fopen(&crash_notes, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  101|   	count = sscanf(line, "%llx", &temp);
#  102|   	if (count != 1)
#  103|-> 		die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
#  104|   	*addr = (uint64_t) temp;
#  105|   	fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
kexec-tools-2.0.32/kexec/crashdump.c:103:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&crash_notes, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:81:14: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/crashdump.c:82:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:99:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:102:12: branch_true: following ‘true’ branch (when ‘count != 1’)...
kexec-tools-2.0.32/kexec/crashdump.c:103:68: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:103:17: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:103:17: danger: ‘fopen(&crash_notes, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  101|   	count = sscanf(line, "%llx", &temp);
#  102|   	if (count != 1)
#  103|-> 		die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
#  104|   	*addr = (uint64_t) temp;
#  105|   	fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def40]
kexec-tools-2.0.32/kexec/crashdump.c:113:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&crash_notes_size, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:82:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:99:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:110:14: acquire_resource: opened here
kexec-tools-2.0.32/kexec/crashdump.c:111:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:112:22: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:112:20: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:114:56: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:113:25: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:113:25: danger: ‘fopen(&crash_notes_size, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  111|   	if (fp) {
#  112|   		if (!fgets(line, sizeof(line), fp))
#  113|-> 			die("Cannot parse %s: %s\n",
#  114|   			    crash_notes_size, strerror(errno));
#  115|   		count = sscanf(line, "%llu", &temp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
kexec-tools-2.0.32/kexec/crashdump.c:113:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&crash_notes_size, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:82:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:99:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:110:14: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/crashdump.c:111:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:112:22: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:112:20: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:114:56: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:113:25: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:113:25: danger: ‘fopen(&crash_notes_size, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  111|   	if (fp) {
#  112|   		if (!fgets(line, sizeof(line), fp))
#  113|-> 			die("Cannot parse %s: %s\n",
#  114|   			    crash_notes_size, strerror(errno));
#  115|   		count = sscanf(line, "%llu", &temp);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def42]
kexec-tools-2.0.32/kexec/crashdump.c:117:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&crash_notes_size, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:82:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:99:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:110:14: acquire_resource: opened here
kexec-tools-2.0.32/kexec/crashdump.c:111:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:112:22: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:116:20: branch_true: following ‘true’ branch (when ‘count != 1’)...
kexec-tools-2.0.32/kexec/crashdump.c:118:56: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:117:25: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:117:25: danger: ‘fopen(&crash_notes_size, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  115|   		count = sscanf(line, "%llu", &temp);
#  116|   		if (count != 1)
#  117|-> 			die("Cannot parse %s: %s\n",
#  118|   			    crash_notes_size, strerror(errno));
#  119|   		*len = (uint64_t) temp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
kexec-tools-2.0.32/kexec/crashdump.c:117:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&crash_notes_size, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:82:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:99:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:110:14: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/crashdump.c:111:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:112:22: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:116:20: branch_true: following ‘true’ branch (when ‘count != 1’)...
kexec-tools-2.0.32/kexec/crashdump.c:118:56: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:117:25: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:117:25: danger: ‘fopen(&crash_notes_size, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  115|   		count = sscanf(line, "%llu", &temp);
#  116|   		if (count != 1)
#  117|-> 			die("Cannot parse %s: %s\n",
#  118|   			    crash_notes_size, strerror(errno));
#  119|   		*len = (uint64_t) temp;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def44]
kexec-tools-2.0.32/kexec/crashdump.c:143:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(kdump_info, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:139:20: acquire_resource: opened here
kexec-tools-2.0.32/kexec/crashdump.c:139:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:142:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:142:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:143:67: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:143:17: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:143:17: danger: ‘fopen(kdump_info, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  141|   
#  142|   	if (!fgets(line, sizeof(line), fp))
#  143|-> 		die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
#  144|   	count = sscanf(line, "%llx %llx", &temp, &temp2);
#  145|   	if (count != 2)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
kexec-tools-2.0.32/kexec/crashdump.c:143:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(kdump_info, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:139:20: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/crashdump.c:139:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:142:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:142:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:143:67: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:143:17: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:143:17: danger: ‘fopen(kdump_info, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  141|   
#  142|   	if (!fgets(line, sizeof(line), fp))
#  143|-> 		die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
#  144|   	count = sscanf(line, "%llx %llx", &temp, &temp2);
#  145|   	if (count != 2)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
kexec-tools-2.0.32/kexec/crashdump.c:146:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(kdump_info, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:139:20: acquire_resource: opened here
kexec-tools-2.0.32/kexec/crashdump.c:139:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:142:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:145:12: branch_true: following ‘true’ branch (when ‘count != 2’)...
kexec-tools-2.0.32/kexec/crashdump.c:146:67: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:146:17: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:146:17: danger: ‘fopen(kdump_info, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  144|   	count = sscanf(line, "%llx %llx", &temp, &temp2);
#  145|   	if (count != 2)
#  146|-> 		die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
#  147|   
#  148|   	*addr = (uint64_t) temp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
kexec-tools-2.0.32/kexec/crashdump.c:146:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(kdump_info, "r")’
kexec-tools-2.0.32/kexec/crashdump.c:139:20: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/crashdump.c:139:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/crashdump.c:142:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:145:12: branch_true: following ‘true’ branch (when ‘count != 2’)...
kexec-tools-2.0.32/kexec/crashdump.c:146:67: branch_true: ...to here
kexec-tools-2.0.32/kexec/crashdump.c:146:17: throw: if ‘die’ throws an exception...
kexec-tools-2.0.32/kexec/crashdump.c:146:17: danger: ‘fopen(kdump_info, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  144|   	count = sscanf(line, "%llx %llx", &temp, &temp2);
#  145|   	if (count != 2)
#  146|-> 		die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
#  147|   
#  148|   	*addr = (uint64_t) temp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
kexec-tools-2.0.32/kexec/firmware_memmap.c:257:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/firmware/memmap")’
kexec-tools-2.0.32/kexec/firmware_memmap.c:244:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/firmware_memmap.c:250:31: branch_false: ...to here
kexec-tools-2.0.32/kexec/firmware_memmap.c:250:31: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/firmware_memmap.c:251:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/firmware_memmap.c:251:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/firmware_memmap.c:257:26: throw: if ‘readdir’ throws an exception...
kexec-tools-2.0.32/kexec/firmware_memmap.c:257:26: danger: ‘opendir("/sys/firmware/memmap")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  255|   
#  256|   	/* parse the entries */
#  257|-> 	while ((dirent = readdir(firmware_memmap_dir)) != NULL) {
#  258|   		int ret;
#  259|   		char full_path[PATH_MAX];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
kexec-tools-2.0.32/kexec/ifdown.c:42:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
kexec-tools-2.0.32/kexec/ifdown.c:34:19: acquire_resource: datagram socket created here
kexec-tools-2.0.32/kexec/ifdown.c:34:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
kexec-tools-2.0.32/kexec/ifdown.c:40:20: branch_false: ...to here
kexec-tools-2.0.32/kexec/ifdown.c:40:12: branch_true: following ‘true’ branch (when ‘ifa’ is NULL)...
kexec-tools-2.0.32/kexec/ifdown.c:41:17: branch_true: ...to here
kexec-tools-2.0.32/kexec/ifdown.c:42:17: throw: if ‘perror’ throws an exception...
kexec-tools-2.0.32/kexec/ifdown.c:42:17: danger: ‘fd’ leaks here
#   40|   	if ((ifa = if_nameindex()) == NULL) {
#   41|   		fprintf(stderr, "ifdown: ");
#   42|-> 		perror("if_nameindex");
#   43|   		goto error;
#   44|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def50]
kexec-tools-2.0.32/kexec/ifdown.c:73:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
kexec-tools-2.0.32/kexec/ifdown.c:34:19: acquire_resource: datagram socket created here
kexec-tools-2.0.32/kexec/ifdown.c:34:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
kexec-tools-2.0.32/kexec/ifdown.c:40:20: branch_false: ...to here
kexec-tools-2.0.32/kexec/ifdown.c:40:12: branch_false: following ‘false’ branch (when ‘ifa’ is non-NULL)...
kexec-tools-2.0.32/kexec/ifdown.c:40:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/ifdown.c:46:26: branch_true: following ‘true’ branch (when ‘shaper != -1’)...
kexec-tools-2.0.32/kexec/ifdown.c:46:26: branch_true: ...to here
kexec-tools-2.0.32/kexec/ifdown.c:73:9: throw: if ‘close’ throws an exception...
kexec-tools-2.0.32/kexec/ifdown.c:73:9: danger: ‘fd’ leaks here
#   71|   	}
#   72|   
#   73|-> 	close(fd);
#   74|   	return 0;
#   75|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def51]
kexec-tools-2.0.32/kexec/ifdown.c:77:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
kexec-tools-2.0.32/kexec/ifdown.c:34:19: acquire_resource: datagram socket created here
kexec-tools-2.0.32/kexec/ifdown.c:34:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
kexec-tools-2.0.32/kexec/ifdown.c:40:20: branch_false: ...to here
kexec-tools-2.0.32/kexec/ifdown.c:40:12: branch_true: following ‘true’ branch (when ‘ifa’ is NULL)...
kexec-tools-2.0.32/kexec/ifdown.c:41:17: branch_true: ...to here
kexec-tools-2.0.32/kexec/ifdown.c:77:9: throw: if ‘close’ throws an exception...
kexec-tools-2.0.32/kexec/ifdown.c:77:9: danger: ‘fd’ leaks here
#   75|   
#   76|   error:
#   77|-> 	close(fd);
#   78|   	return -1;
#   79|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def52]
kexec-tools-2.0.32/kexec/kexec-iomem.c:52:15: warning[-Wanalyzer-null-argument]: use of NULL ‘fopen(proc_iomem(), "r")’ where non-null expected
kexec-tools-2.0.32/kexec/kexec-iomem.c:45:12: branch_false: following ‘false’ branch (when ‘callback’ is non-NULL)...
kexec-tools-2.0.32/kexec/kexec-iomem.c:48:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec-iomem.c:48:14: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/kexec-iomem.c:49:12: release_memory: assuming ‘fopen(proc_iomem(), "r")’ is NULL
kexec-tools-2.0.32/kexec/kexec-iomem.c:49:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/kexec-iomem.c:50:17: branch_true: ...to here
kexec-tools-2.0.32/kexec/kexec-iomem.c:52:15: danger: argument 3 (‘fopen(proc_iomem(), "r")’) NULL where non-null expected
#   50|   		die("Cannot open %s\n", iomem);
#   51|   
#   52|-> 	while(fgets(line, sizeof(line), fp) != 0) {
#   53|   		count = sscanf(line, "%llx-%llx : %n", &start, &end, &consumed);
#   54|   		if (count != 2)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c:82:19: warning[-Wanalyzer-malloc-leak]: leak of ‘fname’
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c:56:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c:65:20: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c:72:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c:77:23: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c:77:23: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c:77:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c:82:19: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c:82:19: throw: if ‘mkstemp’ throws an exception...
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c:82:19: danger: ‘fname’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#   80|   	}
#   81|   
#   82|-> 	if ((fd = mkstemp(fname)) < 0) {
#   83|   		dbgprintf("%s: Can't open file %s\n", __func__,	fname);
#   84|   		ret = -1;

Error: COMPILER_WARNING (CWE-252): [#def54]
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c: scope_hint: In function ‘pez_prepare’
kexec-tools-2.0.32/kexec/kexec-pe-zboot.c:115:25: warning[-Wunused-result]: ignoring return value of ‘ftruncate’ declared with attribute ‘warn_unused_result’
#  115 |                         ftruncate(fd, 0);
#      |                         ^~~~~~~~~~~~~~~~
#  113|   		if (dir->certs.virtual_address != 0 && dir->certs.size != 0) {
#  114|   			original_file_sz = dir->certs.virtual_address + dir->certs.size;
#  115|-> 			ftruncate(fd, 0);
#  116|   		}
#  117|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
kexec-tools-2.0.32/kexec/kexec-uki.c:33:19: warning[-Wanalyzer-malloc-leak]: leak of ‘fname’
kexec-tools-2.0.32/kexec/kexec-uki.c:28:23: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/kexec-uki.c:28:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
kexec-tools-2.0.32/kexec/kexec-uki.c:33:19: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec-uki.c:33:19: throw: if ‘mkstemp’ throws an exception...
kexec-tools-2.0.32/kexec/kexec-uki.c:33:19: danger: ‘fname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   31|   	}
#   32|   
#   33|-> 	if ((fd = mkstemp(fname)) < 0) {
#   34|   		dbgprintf("%s: Can't open file %s\n", __func__,	fname);
#   35|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def56]
kexec-tools-2.0.32/kexec/kexec.c:507:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(filename, 0)’
kexec-tools-2.0.32/kexec/kexec.c:1476:5: enter_function: entry to ‘main’
kexec-tools-2.0.32/kexec/kexec.c:1507:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
kexec-tools-2.0.32/kexec/kexec.c:1509:17: branch_true: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1574:28: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/kexec.c:1574:28: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1654:12: branch_false: following ‘false’ branch (when ‘skip_ifdown == 0’)...
kexec-tools-2.0.32/kexec/kexec.c:1656:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1656:12: branch_false: following ‘false’ branch (when ‘skip_sync == 0’)...
kexec-tools-2.0.32/kexec/kexec.c:1659:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1659:12: branch_false: following ‘false’ branch (when ‘do_status == 0’)...
kexec-tools-2.0.32/kexec/kexec.c:1673:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1673:12: branch_true: following ‘true’ branch (when ‘do_load != 0’)...
kexec-tools-2.0.32/kexec/kexec.c:1674:14: branch_true: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1673:13: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/kexec.c:1675:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1674:13: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/kexec.c:1683:12: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1683:12: branch_true: following ‘true’ branch (when ‘do_load != 0’)...
kexec-tools-2.0.32/kexec/kexec.c:1683:24: branch_true: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1683:13: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/kexec.c:1690:24: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1690:13: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/kexec.c:1695:13: branch_false: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1695:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/kexec/kexec.c:1697:29: branch_true: ...to here
kexec-tools-2.0.32/kexec/kexec.c:1699:23: call_function: calling ‘slurp_file_len’ from ‘main’
#  505|   	ssize_t result;
#  506|   
#  507|-> 	buf = xmalloc(size);
#  508|   	progress = 0;
#  509|   	while (progress < size) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
kexec-tools-2.0.32/kexec/kexec.c:525:18: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)size)’
kexec-tools-2.0.32/kexec/kexec.c:637:7: enter_function: entry to ‘slurp_decompress_file’
kexec-tools-2.0.32/kexec/kexec.c:647:40: call_function: inlined call to ‘slurp_file’ from ‘slurp_decompress_file’
#  523|   		progress += result;
#  524|   	}
#  525|-> 	result = close(fd);
#  526|   	if (result < 0)
#  527|   		die("Close of %s failed: %s\n", filename, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
kexec-tools-2.0.32/kexec/kexec.c:526:12: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)size)’
kexec-tools-2.0.32/kexec/kexec.c:637:7: enter_function: entry to ‘slurp_decompress_file’
kexec-tools-2.0.32/kexec/kexec.c:647:40: call_function: inlined call to ‘slurp_file’ from ‘slurp_decompress_file’
#  524|   	}
#  525|   	result = close(fd);
#  526|-> 	if (result < 0)
#  527|   		die("Close of %s failed: %s\n", filename, strerror(errno));
#  528|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def59]
kexec-tools-2.0.32/kexec/zstd.c:29:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
kexec-tools-2.0.32/kexec/zstd.c:76:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
kexec-tools-2.0.32/kexec/zstd.c:79:13: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:79:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/zstd.c:83:13: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:83:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/zstd.c:87:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:89:14: acquire_resource: opened here
kexec-tools-2.0.32/kexec/zstd.c:90:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/zstd.c:95:13: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:95:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/zstd.c:100:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:100:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/zstd.c:105:17: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:105:17: throw: if ‘xmalloc’ throws an exception...
kexec-tools-2.0.32/kexec/zstd.c:29:14: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#   27|   	uint8_t *buf = (uint8_t *)buffer;
#   28|   	/* Magic zstd frame header value */
#   29|-> 	if ((buf[0] == 0x28) &&
#   30|   	    (buf[1] == 0xB5) &&
#   31|   	    (buf[2] == 0x2F) &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
kexec-tools-2.0.32/kexec/zstd.c:29:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
kexec-tools-2.0.32/kexec/zstd.c:76:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
kexec-tools-2.0.32/kexec/zstd.c:79:13: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:79:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/zstd.c:83:13: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:83:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/zstd.c:87:9: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:89:14: acquire_memory: allocated here
kexec-tools-2.0.32/kexec/zstd.c:90:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/zstd.c:95:13: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:95:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/zstd.c:100:14: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:100:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/kexec/zstd.c:105:17: branch_false: ...to here
kexec-tools-2.0.32/kexec/zstd.c:105:17: throw: if ‘xmalloc’ throws an exception...
kexec-tools-2.0.32/kexec/zstd.c:29:14: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#   27|   	uint8_t *buf = (uint8_t *)buffer;
#   28|   	/* Magic zstd frame header value */
#   29|-> 	if ((buf[0] == 0x28) &&
#   30|   	    (buf[1] == 0xB5) &&
#   31|   	    (buf[2] == 0x2F) &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
kexec-tools-2.0.32/util_lib/elf_info.c:1129:15: warning[-Wanalyzer-malloc-leak]: leak of ‘m.prb’
kexec-tools-2.0.32/util_lib/elf_info.c:1213:6: enter_function: entry to ‘dump_dmesg’
kexec-tools-2.0.32/util_lib/elf_info.c:1215:12: branch_true: following ‘true’ branch...
kexec-tools-2.0.32/util_lib/elf_info.c:1216:17: branch_true: ...to here
kexec-tools-2.0.32/util_lib/elf_info.c:1216:17: call_function: calling ‘dump_dmesg_lockless’ from ‘dump_dmesg’
# 1127|   		exit(64);
# 1128|   	}
# 1129|-> 	ret = pread(fd, m.prb, printk_ringbuffer_sz, vaddr_to_offset(kaddr));
# 1130|   	if (ret != printk_ringbuffer_sz) {
# 1131|   		fprintf(stderr, "Failed to read prb of size %zu bytes: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def62]
kexec-tools-2.0.32/vmcore-dmesg/vmcore-dmesg.c:34:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(argv[1], 0)’
kexec-tools-2.0.32/vmcore-dmesg/vmcore-dmesg.c:46:5: enter_function: entry to ‘main’
kexec-tools-2.0.32/vmcore-dmesg/vmcore-dmesg.c:51:12: branch_false: following ‘false’ branch (when ‘argc == 2’)...
kexec-tools-2.0.32/vmcore-dmesg/vmcore-dmesg.c:55:9: branch_false: ...to here
kexec-tools-2.0.32/vmcore-dmesg/vmcore-dmesg.c:57:14: acquire_resource: opened here
kexec-tools-2.0.32/vmcore-dmesg/vmcore-dmesg.c:58:12: branch_false: following ‘false’ branch...
kexec-tools-2.0.32/vmcore-dmesg/vmcore-dmesg.c:64:15: branch_false: ...to here
kexec-tools-2.0.32/vmcore-dmesg/vmcore-dmesg.c:64:15: call_function: calling ‘read_vmcore_dmesg’ from ‘main’
#   32|   	int ret;
#   33|   
#   34|-> 	ret = read_elf(fd);
#   35|   	if (ret > 0) {
#   36|   		fprintf(stderr, "Unable to read ELF information"

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-194.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namekexec-tools-2.0.32-1.fc44
store-results-to/tmp/tmpkdw_4vef/kexec-tools-2.0.32-1.fc44.tar.xz
time-created2026-01-08 17:29:37
time-finished2026-01-08 17:30:58
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpkdw_4vef/kexec-tools-2.0.32-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpkdw_4vef/kexec-tools-2.0.32-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9