mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Fix memory corruption in bytes().appendb64()
This commit is contained in:
parent
a939b4973e
commit
cfc11b5e83
@ -1399,7 +1399,7 @@ static int m_appendb64(bvm *vm)
|
||||
if (idx + len >= attr2.len) { len = attr2.len - idx; }
|
||||
}
|
||||
if (len > 0) { /* only if there is something to encode */
|
||||
bytes_resize(vm, &attr, attr.len + encode_base64_length(len)); /* resize */
|
||||
bytes_resize(vm, &attr, attr.len + encode_base64_length(len) + 1); /* resize */
|
||||
|
||||
size_t converted = encode_base64(attr2.bufptr + idx, len, (unsigned char*)(attr.bufptr + attr.len));
|
||||
attr.len += converted;
|
||||
|
Loading…
x
Reference in New Issue
Block a user