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) {
|
||||
static char *dest = nullptr;
|
||||
if(dest) {
|
||||
free(dest);
|
||||
}
|
||||
dest = (char*)malloc(size);
|
||||
char *dest = (char*)malloc(size+1);
|
||||
if (!dest) {
|
||||
return nullptr;
|
||||
}
|
||||
if (size != stream.readBytes(dest, size)) {
|
||||
free(dest);
|
||||
dest = nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
dest[size] = '\0';
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user