summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-05-29 15:57:12 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-05-29 15:57:12 +0300
commitcaba8208505a9883d7121c55ca6791b32832ff29 (patch)
treeaa485981efcdac30b8a9798d5927c697e9b474c5
parent878274e008cafa7e1a9bd38297f4d2eed4bdebba (diff)
fix for the buffer calculation in base64_decode
-rw-r--r--src/mir_core/src/http.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mir_core/src/http.cpp b/src/mir_core/src/http.cpp
index 2494467ad3..12d2add914 100644
--- a/src/mir_core/src/http.cpp
+++ b/src/mir_core/src/http.cpp
@@ -164,7 +164,7 @@ MIR_CORE_DLL(void*) mir_base64_decode(const char *input, size_t *outputLen)
return nullptr;
size_t length = strlen(input);
- size_t nLength = (length / 4) * 3;
+ size_t nLength = ((length + 3) / 4) * 3;
const char *stop = input + length;
char *output = (char *)mir_alloc(nLength+1);