From 456f831389f30f5fcc35f1ce07d63a34e30f039a Mon Sep 17 00:00:00 2001 From: Igor Zinkovsky Date: Fri, 14 Oct 2011 15:37:28 -0700 Subject: [PATCH] windows: ensure that the ipc frame header is properly initialized --- src/win/pipe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/win/pipe.c b/src/win/pipe.c index 2b555790..9c90fda0 100644 --- a/src/win/pipe.c +++ b/src/win/pipe.c @@ -778,6 +778,8 @@ static int uv_pipe_write_impl(uv_loop_t* loop, uv_write_t* req, memset(&req->overlapped, 0, sizeof(req->overlapped)); if (handle->ipc) { + ipc_frame.header.flags = 0; + /* Use the IPC framing protocol. */ if (send_handle) { tcp_send_handle = (uv_tcp_t*)send_handle; @@ -997,6 +999,7 @@ void uv_process_pipe_read_req(uv_loop_t* loop, uv_pipe_t* handle, } assert(bytes == sizeof(ipc_frame.header)); + assert(ipc_frame.header.flags <= UV_IPC_UV_STREAM | UV_IPC_RAW_DATA); if (ipc_frame.header.flags & UV_IPC_UV_STREAM) { assert(avail - sizeof(ipc_frame.header) >=