[Core] Fix the null char in truncated value returned by switch_b64_decode

This commit is contained in:
windy-wang
2020-09-02 01:04:49 +08:00
committed by GitHub
parent 9c01bd4c78
commit 1d2a1057f8
2 changed files with 21 additions and 3 deletions

View File

@@ -26,7 +26,7 @@
* Anthony Minessale II <anthm@freeswitch.org>
* Juan Jose Comellas <juanjo@comellas.org>
* Seven Du <dujinfang@gmail.com>
*
* Windy Wang <xiaofengcanyuexp@163.com>
*
* switch_utils.c -- Compatibility and Helper Code
*
@@ -1081,7 +1081,7 @@ SWITCH_DECLARE(switch_size_t) switch_b64_decode(const char *in, char *out, switc
while (l >= 8) {
op[ol++] = (char) ((b >> (l -= 8)) % 256);
if (ol >= olen - 2) {
if (ol >= olen - 1) {
goto end;
}
}