summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/utils.c b/main/utils.c
index a4b0a4557..80fadfdcc 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -352,6 +352,9 @@ int ast_base64decode(unsigned char *dst, const char *src, int max)
cnt++;
}
}
+ if (cnt == max)
+ dst--;
+ *dst = '\0';
/* Dont worry about left over bits, they're extra anyway */
return cnt;
}