Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dgram: add nread assertion to UDPWrap::OnRecv #40295

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/udp_wrap.cc
Expand Up @@ -20,7 +20,6 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "udp_wrap.h"
#include "allocated_buffer-inl.h"
#include "env-inl.h"
#include "node_buffer.h"
#include "node_sockaddr-inl.h"
Expand Down Expand Up @@ -725,6 +724,7 @@ void UDPWrap::OnRecv(ssize_t nread,
} else if (nread == 0) {
bs = ArrayBuffer::NewBackingStore(isolate, 0);
} else {
CHECK_LE(static_cast<size_t>(nread), bs->ByteLength());
bs = BackingStore::Reallocate(isolate, std::move(bs), nread);
}

Expand Down