aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--lib/libbindle/lencoding.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libbindle/lencoding.c b/lib/libbindle/lencoding.c
index f9bc041..c24623b 100644
--- a/lib/libbindle/lencoding.c
+++ b/lib/libbindle/lencoding.c
@@ -638,6 +638,8 @@ bindle_base64_decode(
638 638
639 // byte 2 639 // byte 2
640 case 2: 640 case 2:
641 if (src[pos] == '=')
642 return((ssize_t)datlen-1);
641 dst[datlen-1] |= (map[(unsigned char)src[pos]] & 0x3c) >> 2; // 4 MSB 643 dst[datlen-1] |= (map[(unsigned char)src[pos]] & 0x3c) >> 2; // 4 MSB
642 dst[datlen++] = (map[(unsigned char)src[pos]] & 0x03) << 6; // 2 LSB 644 dst[datlen++] = (map[(unsigned char)src[pos]] & 0x03) << 6; // 2 LSB
643 break; 645 break;
@@ -645,6 +647,8 @@ bindle_base64_decode(
645 // byte 3 647 // byte 3
646 case 3: 648 case 3:
647 default: 649 default:
650 if (src[pos] == '=')
651 return((ssize_t)datlen-1);
648 dst[datlen-1] |= (map[(unsigned char)src[pos]] & 0x3f); // 1 MSB 652 dst[datlen-1] |= (map[(unsigned char)src[pos]] & 0x3f); // 1 MSB
649 break; 653 break;
650 }; 654 };