From 75039c573cf662611d9dcee40ac0f49f87b44493 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 3 Oct 2016 22:04:32 +0900 Subject: [PATCH] base64: Assert that input is multiple of 4 --- src/base64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base64.h b/src/base64.h index c173a5a5..c8b16e8c 100644 --- a/src/base64.h +++ b/src/base64.h @@ -108,7 +108,7 @@ OutputIt decode(InputIt first, InputIt last, OutputIt d_first) { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; - + assert(std::distance(first, last) % 4 == 0); auto p = d_first; for (; first != last;) { uint32_t n = 0;