NetBSD/usr.sbin/installboot/arch
kamil 49b4c5f864 Fix integer overflow in installboot(8)
Add a sanity check of the disk_buf first three bytes. The original code on
a disk with nul bytes was causing integer overflow and thus calling the
memcmp(3) functin in is_zero() with enormous length.

Verity that the 0th byte is JMP, 1th a signed byte >=9 to prevent overflow
and 2th byte NOP.

Add a comment explaining the check.

Detected with MKSANITIZER and ASan.
2018-06-23 14:15:57 +00:00
..
alpha.c
amiga.c
emips.c
ews4800mips.c
hp300.c
hppa.c
i386.c Fix integer overflow in installboot(8) 2018-06-23 14:15:57 +00:00
landisk.c
macppc.c
news.c
next68k.c
pmax.c
sparc.c
sparc64.c
sun68k.c
vax.c
x68k.c