From fab06765e47d2c19646f803d190a57f5b2b783f8 Mon Sep 17 00:00:00 2001 From: Juraj Andrassy Date: Sun, 16 Jun 2024 18:16:55 +0200 Subject: [PATCH] SocketWrapper MbedClient stopped client read() crash fix --- libraries/SocketWrapper/src/MbedClient.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/SocketWrapper/src/MbedClient.cpp b/libraries/SocketWrapper/src/MbedClient.cpp index 49188df7e..2bb933350 100644 --- a/libraries/SocketWrapper/src/MbedClient.cpp +++ b/libraries/SocketWrapper/src/MbedClient.cpp @@ -229,6 +229,8 @@ int arduino::MbedClient::available() { } int arduino::MbedClient::read() { + if (sock == nullptr) + return -1; mutex->lock(); if (!available()) { mutex->unlock(); @@ -241,6 +243,8 @@ int arduino::MbedClient::read() { } int arduino::MbedClient::read(uint8_t *data, size_t len) { + if (sock == nullptr) + return 0; mutex->lock(); int avail = available(); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy