Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 13947c2

Browse files
SocketWrapper MbedClient stopped client read() crash fix
1 parent 0108ded commit 13947c2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎libraries/SocketWrapper/src/MbedClient.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ int arduino::MbedClient::available() {
229229
}
230230

231231
int arduino::MbedClient::read() {
232+
if (sock == nullptr)
233+
return -1;
232234
mutex->lock();
233235
if (!available()) {
234236
mutex->unlock();
@@ -241,6 +243,8 @@ int arduino::MbedClient::read() {
241243
}
242244

243245
int arduino::MbedClient::read(uint8_t *data, size_t len) {
246+
if (sock == nullptr)
247+
return -1;
244248
mutex->lock();
245249
int avail = available();
246250

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /