[Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

Christian Franke Christian.Franke@t-online.de
Fri May 18 19:02:00 GMT 2007


Cygwin 1.5.24-2 segfaults on unaligned lseek() on raw block devices with 
sector size >512 bytes.

$ dd skip=1000 bs=2047 if=/dev/scd0 of=/dev/null

$ ddrescue -c 1 /dev/scd0 file.iso

This is due to a fixed 512 byte buffer in fhandler_dev_floppy::lseek().
It is still present in HEAD revision.

The attached patch should fix. It should work for any sector size.
(Smoke-)tested with 1.5.24-2 (too busy to test with current CVS, sorry).

2007-05-18  Christian Franke <franke@computer.org>

	* fhandler_floppy.cc (fhandler_dev_floppy::lseek): Fixed segfault on
	unaligned seek due to fixed size buffer.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygwin-1.5.24-2-rawseek.patch.txt
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20070518/835e1baf/attachment.txt>

More information about the Cygwin-patches mailing list