未验证 提交 11d071b1 编写于 作者: P pulquero 提交者: GitHub

Fix to allow more than one certificate to be loaded (espressif#3248). (#4056)

Co-authored-by: NMark Hale <mark.hale@physics.org>
上级 f48d9016
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册