New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-mbed-dtls-client

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-mbed-dtls-client - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# 1.0.2
* Fix send callback handling to prevent deadlock
# 1.0.1

@@ -2,0 +6,0 @@

2

package.json
{
"name": "node-mbed-dtls-client",
"version": "1.0.1",
"version": "1.0.2",
"description": "DTLS client created by wrapping mbedtls",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -70,23 +70,23 @@ 'use strict';

_sendEncrypted(msg) {
if (!this.dgramSocket || !this.dgramSocket._handle) {
if (this._sendCallback) {
this._sendCallback(new Error('no underlying socket'));
this._sendCallback = null;
// store the callback here because '_write' might be called
// again before the underlying socket finishes sending
const sendCb = this._sendCallback;
this._sendCallback = null;
const sendFinished = (err) => {
if (sendCb) {
sendCb(err);
}
if (this._sendNotify) {
process.nextTick(() => {
this._closeSocket();
});
this._closeSocket();
}
};
if (!this.dgramSocket || !this.dgramSocket._handle) {
process.nextTick(() => {
sendFinished(new Error('no underlying socket'));
});
return;
}
this.dgramSocket.send(msg, 0, msg.length, this.remotePort, this.remoteAddress, err => {
if (this._sendCallback) {
this._sendCallback(err);
this._sendCallback = null;
}
if (this._sendNotify) {
this._closeSocket();
}
});
this.dgramSocket.send(msg, 0, msg.length, this.remotePort, this.remoteAddress, sendFinished);
}

@@ -106,3 +106,8 @@

this._hadError = true;
this.emit('error', code, msg);
if (this._sendCallback) {
this._sendCallback(code);
this._sendCallback = null;
} else {
this.emit('error', code, msg);
}
this._end();

@@ -109,0 +114,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc