--- cygwin-1.5.24-2.orig/winsup/cygwin/fhandler_floppy.cc 2006-07-18 14:56:37.001000000 +0200 +++ cygwin-1.5.24-2/winsup/cygwin/fhandler_floppy.cc 2007-05-18 19:53:07.468750000 +0200 @@ -12,6 +12,7 @@ details. */ #include "winsup.h" #include #include +#include #include #include #include @@ -408,7 +409,6 @@ fhandler_dev_floppy::raw_write (const vo _off64_t fhandler_dev_floppy::lseek (_off64_t offset, int whence) { - char buf[512]; _off64_t lloffset = offset; LARGE_INTEGER sector_aligned_offset; _off64_t bytes_left; @@ -454,7 +454,14 @@ fhandler_dev_floppy::lseek (_off64_t off if (bytes_left) { size_t len = bytes_left; + char *buf = (char *) malloc (len); + if (!buf) + { + set_errno (ENOMEM); + return -1; + } raw_read (buf, len); + free(buf); } return sector_aligned_offset.QuadPart + bytes_left; }