zdump/dfi: Fix format string specifiers in dfi_info_print()

Replace the incorrect %d format specifier with %u one for unsigned integer
types.

This issue was found with AFL fuzzing.

$ ./zdump/zgetdump -i ~/input.bin
General dump info:
  Dump format........: s390
  Version............: -2147483647
  System arch........: s390x (64 bit)
  CPU count (online).: 32768
  Dump memory range..: 1 MB

Memory map:
  0000000000000000 - 00000000000f423f (1 MB)

Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Alexander Egorenkov
2021-09-02 10:48:28 +02:00
committed by Jan Höppner
parent e3e5b6422a
commit de36fc5259

View File

@@ -236,7 +236,7 @@ void dfi_info_print(void)
STDERR("General dump info:\n");
STDERR(" Dump format........: %s\n", l.dfi->name);
if (l.attr.dfi_version)
STDERR(" Version............: %d\n", *l.attr.dfi_version);
STDERR(" Version............: %u\n", *l.attr.dfi_version);
date_print();
if (l.attr.dump_method)
STDERR(" Dump method........: %s\n", l.attr.dump_method);
@@ -248,15 +248,15 @@ void dfi_info_print(void)
STDERR(" UTS kernel version.: %s\n", l.attr.utsname->version);
}
if (l.attr.vol_nr)
STDERR(" Volume number......: %d\n", *l.attr.vol_nr);
STDERR(" Volume number......: %u\n", *l.attr.vol_nr);
if (l.attr.build_arch)
STDERR(" Build arch.........: %s\n",
dfi_arch_str(*l.attr.build_arch));
STDERR(" System arch........: %s\n", dfi_arch_str(l.arch));
if (l.cpus.cnt)
STDERR(" CPU count (online).: %d\n", l.cpus.cnt);
STDERR(" CPU count (online).: %u\n", l.cpus.cnt);
if (l.attr.real_cpu_cnt)
STDERR(" CPU count (real)...: %d\n", *l.attr.real_cpu_cnt);
STDERR(" CPU count (real)...: %u\n", *l.attr.real_cpu_cnt);
if (dfi_mem_range())
STDERR(" Dump memory range..: %lld MB\n",
TO_MIB(dfi_mem_range()));