Fix to allow more than one certificate to be loaded (espressif#3248). (#4056)
Co-authored-by: Mark Hale <mark.hale@physics.org>
This commit is contained in:
parent
f48d9016fd
commit
11d071b1c8
@ -274,18 +274,16 @@ bool WiFiClientSecure::verify(const char* fp, const char* domain_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *WiFiClientSecure::_streamLoad(Stream& stream, size_t size) {
|
char *WiFiClientSecure::_streamLoad(Stream& stream, size_t size) {
|
||||||
static char *dest = nullptr;
|
char *dest = (char*)malloc(size+1);
|
||||||
if(dest) {
|
|
||||||
free(dest);
|
|
||||||
}
|
|
||||||
dest = (char*)malloc(size);
|
|
||||||
if (!dest) {
|
if (!dest) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (size != stream.readBytes(dest, size)) {
|
if (size != stream.readBytes(dest, size)) {
|
||||||
free(dest);
|
free(dest);
|
||||||
dest = nullptr;
|
dest = nullptr;
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
dest[size] = '\0';
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user