projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c4452ae
)
DecodeBase64: wrapper needs to 0-terminate buffer.
author
Wilfried Goesgens
<dothebart@citadel.org>
Sat, 10 May 2014 09:20:55 +0000
(11:20 +0200)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Sat, 10 May 2014 09:20:55 +0000
(11:20 +0200)
libcitadel/lib/tools.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/tools.c
b/libcitadel/lib/tools.c
index fa8f1657db46ec35462622c77dcfca53ceb60eb4..bc0cb767b3cbaa613723452761453117f0cf84f2 100644
(file)
--- a/
libcitadel/lib/tools.c
+++ b/
libcitadel/lib/tools.c
@@
-342,10
+342,13
@@
size_t CtdlEncodeBase64(char *dest, const char *source, size_t sourcelen, int li
int CtdlDecodeBase64(char *dest, const char *source, size_t length)
{
base64_decodestate _state;
+ int len;
base64_init_decodestate(&_state);
- return base64_decode_block(source, length, dest, &_state);
+ len = base64_decode_block(source, length, dest, &_state);
+ dest[len] = '\0';
+ return len;
}