mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-29 23:27:13 +02:00
set minimum bufsize for base64 encode
This commit is contained in:
@ -571,6 +571,7 @@ String WebSockets::acceptKey(String & clientKey) {
|
||||
*/
|
||||
String WebSockets::base64_encode(uint8_t * data, size_t length) {
|
||||
size_t size = ((length * 1.6f) + 1);
|
||||
size = std::max(size, (size_t) 5); //minimum buffer size
|
||||
char * buffer = (char *)malloc(size);
|
||||
if(buffer) {
|
||||
base64_encodestate _state;
|
||||
|
Reference in New Issue
Block a user