Skip to content

Commit 7b20636

Browse files
author
Mark Hale
committed
Fix to allow more than one certificate to be loaded (#3248).
1 parent 13e0206 commit 7b20636

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: libraries/WiFiClientSecure/src/WiFiClientSecure.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -274,18 +274,15 @@ bool WiFiClientSecure::verify(const char* fp, const char* domain_name)
274274
}
275275

276276
char *WiFiClientSecure::_streamLoad(Stream& stream, size_t size) {
277-
static char *dest = nullptr;
278-
if(dest) {
279-
free(dest);
280-
}
281-
dest = (char*)malloc(size);
277+
char *dest = (char*)malloc(size+1);
282278
if (!dest) {
283279
return nullptr;
284280
}
285281
if (size != stream.readBytes(dest, size)) {
286282
free(dest);
287283
dest = nullptr;
288284
}
285+
dest[size] = '\0';
289286
return dest;
290287
}
291288

0 commit comments

Comments
 (0)