summaryrefslogtreecommitdiff
path: root/src/utils/base64.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/base64.cpp')
-rw-r--r--src/utils/base64.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp
index 57bc68a7c..feed37066 100644
--- a/src/utils/base64.cpp
+++ b/src/utils/base64.cpp
@@ -48,8 +48,9 @@ unsigned char *php3_base64_encode(const unsigned char *restrict const string,
{
const unsigned char *current = string;
int i = 0;
- unsigned char *const result = static_cast<unsigned char *>(calloc(
- ((length + 3 - length % 3) * 4 / 3 + 1) * sizeof(unsigned char), 1));
+ unsigned char *const result = static_cast<unsigned char *>(
+ calloc(static_cast<size_t>((length + 3 - length % 3) * 4 / 3 + 1)
+ * sizeof(unsigned char), 1));
if (!result)
return nullptr;