From 15db80b459658b588e877a92ea96d1a10d75302e Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Wed, 19 Aug 2015 13:40:22 -0700 Subject: [PATCH] NUL terminate decoded base64 string For consistency with encoded strings. --- src/string_util.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/string_util.cpp b/src/string_util.cpp index 2428149..4a6d71c 100644 --- a/src/string_util.cpp +++ b/src/string_util.cpp @@ -362,6 +362,7 @@ unsigned char* s3fs_decode64(const char* input, size_t* plength) } result[wpos++] = ((parts[2] << 6) & 0xc0) | (parts[3] & 0x3f); } + result[wpos] = '\0'; *plength = wpos; return result; }