openSUSE / imagewriter

Utility for writing raw disk images & hybrid isos to USB keys
GNU General Public License v2.0
178 stars 164 forks source link

Doesn't write the end of the input file in some cases #20

Open julianladisch opened 6 years ago

julianladisch commented 6 years ago

i++ in https://github.com/openSUSE/imagewriter/blob/531d36b/Platform.cpp#L112 causes the end of the input file not to be written in some cases.

How to reproduce:

# write 3 MB plus 1 byte of zeroes
sudo dd if=/dev/zero of=/dev/sdb bs=3145729 count=1
# create 3 MB containing \xaa\x55 and 1 byte with character a
printf %3145728sa | sed 's/  /\xaa\x55/g' > a.iso
imagewriter -d /dev/sdb -f a.iso
# read the byte after 3 MB
sudo dd status=none if=/dev/sdb bs=1 skip=3145728 count=1

Expected result: a The actual result is a null byte.