This is the mail archive of the cygwin-patches mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
...
I'm just looking at fhandler_floopy.cc for the first time,
but, isn't there the possibility that bytes_left can be a bit too big
for alloca?
It looks like that the raw_read call is there to advance the position by the needed amount (moving back is forbidden a bit above). Perhaps it would be better to read in a loop with read amount limited by the size of the buffer:
while more bytes do read minimum of bytes left or size of buffer if couldn't read, bail out. (oooops internal state broken now). done
BTW: This "oooops" may be an issue in the current code. The lseek() call returns success if raw_read() fails. This may possibly lead to undetected read errors in very rare cases.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |