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, 4 insertions, 1 deletions
diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp
index 88fe8bf8f..7be63c090 100644
--- a/src/utils/base64.cpp
+++ b/src/utils/base64.cpp
@@ -42,8 +42,11 @@ static char base64_table[] =
static const char base64_pad = '=';
unsigned char *php3_base64_encode(const unsigned char *restrict const string,
- int length, int *restrict const ret_length)
+ int length,
+ int *restrict const ret_length)
{
+ if (!string)
+ return nullptr;
const unsigned char *current = string;
int i = 0;
unsigned char *const result = static_cast<unsigned char *>(