summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/wee-string.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/wee-string.c b/src/core/wee-string.c
index 4c893c9f5..de4443773 100644
--- a/src/core/wee-string.c
+++ b/src/core/wee-string.c
@@ -2338,6 +2338,9 @@ string_encode_base16 (const char *from, int length, char *to)
const char *hexa = "0123456789ABCDEF";
char *ptr_to;
+ if (!from || !to)
+ return;
+
ptr_to = to;
ptr_to[0] = '\0';
for (i = 0; i < length; i++)
@@ -2361,6 +2364,9 @@ string_decode_base16 (const char *from, char *to)
int length, to_length, i, pos;
unsigned char *ptr_to, value;
+ if (!from || !to)
+ return 0;
+
length = strlen (from) / 2;
ptr_to = (unsigned char *)to;
@@ -2425,6 +2431,9 @@ string_encode_base64 (const char *from, int length, char *to)
const char *ptr_from;
char *ptr_to;
+ if (!from || !to)
+ return;
+
ptr_from = from;
ptr_to = to;
@@ -2487,6 +2496,9 @@ string_decode_base64 (const char *from, char *to)
unsigned char base64_table[]="|$$$}rstuvwxyz{$$$$$$$>?"
"@ABCDEFGHIJKLMNOPQRSTUVW$$$$$$XYZ[\\]^_`abcdefghijklmnopq";
+ if (!from || !to)
+ return 0;
+
ptr_from = from;
ptr_to = to;