From 11e53cfc81edd63e8854ccf9a75845cca5890292 Mon Sep 17 00:00:00 2001 From: Stephan Hesse Date: Tue, 23 Mar 2021 12:26:58 +0100 Subject: [PATCH] fixes #17: we set this 0 since not using their_addr output by accept call, but SRT v1.4.2 is checking for this size to be large enough to write into it the actual address in the first place. anyhow, wether we read it or not, it doesn't matter, the allocated size of sockaddr_in is always the same (per any platform). --- src/node-srt.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node-srt.cc b/src/node-srt.cc index b29430e..542145a 100644 --- a/src/node-srt.cc +++ b/src/node-srt.cc @@ -168,7 +168,7 @@ Napi::Value NodeSRT::Accept(const Napi::CallbackInfo& info) { Napi::Number socketValue = info[0].As(); sockaddr_in their_addr; - int addr_size; + int addr_size = sizeof (sockaddr_in); int their_fd = srt_accept(socketValue, (struct sockaddr *)&their_addr, &addr_size); if (their_fd == SRT_INVALID_SOCK) {