This is the mail archive of the cygwin-patches@cygwin.com 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]

Re: [PATCH] Serial code stack corruption


On Mon, Dec 10, 2001 at 03:22:28PM -0800, Victor Tsou wrote:
>
>WaitCommEvent was called in overlapped mode with a pointer to a stack
>variable passed in for lpEvtMask. When the asynchronous request completes in
>the future, the function might no longer be in scope. In such cases, data on
>the stack is erroneously overwritten with the event mask.
>
>This patch cancels the WaitCommEvent request by calling SetCommMask. This is
>the only documented method of cancelling the eventmask update.

Do you actually have a test case that illustrates this scenario?

I don't remember any more but I thought that raw_read wasn't supposed to be
exited unless I/O was complete.

However, I've added an 'ev' field to the fhandler_serial class which can
be used for this.  I think that should eliminate any possibility of
stack corruption.

Thanks for the patch.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]