1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-05 00:06:16 +00:00

Merge pull request #1172 from zevv/windows-recvfrom

fix for crash on windows in src/core/ev.c: initialze state->fromlen
This commit is contained in:
Calvin Rose 2023-05-30 16:54:24 -05:00 committed by GitHub
commit 961c6ea15a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2320,6 +2320,7 @@ JanetAsyncStatus ev_machine_read(JanetListenerState *s, JanetAsyncEvent event) {
if (state->mode == JANET_ASYNC_READMODE_RECVFROM) {
state->wbuf.len = (ULONG) chunk_size;
state->wbuf.buf = (char *) state->chunk_buf;
state->fromlen = sizeof(state->from);
status = WSARecvFrom((SOCKET) s->stream->handle, &state->wbuf, 1,
NULL, &state->flags, &state->from, &state->fromlen, &state->overlapped, NULL);
if (status && (WSA_IO_PENDING != WSAGetLastError())) {