From ddd55f62218a01979370e31d361bbb5f94afaa88 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 2 Jan 2019 10:29:27 +0100 Subject: [PATCH] Added color-size check to sigil algorithm. --- src/checks.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/checks.cpp b/src/checks.cpp index 782a137..1ac900e 100644 --- a/src/checks.cpp +++ b/src/checks.cpp @@ -54,6 +54,11 @@ void Identiconpp::check_entropy(const string &digest, algorithm type) } case algorithm::sigil: { + if (_foreground.size() > 256) + { + throw std::invalid_argument( + "sigil algorithm does not support more than 256 colors."); + } entropy_provided = digest.length() * 4; entropy_required = (_columns / 2 + _columns % 2) * _rows + 8; break;