From dffe2a444e63be8afc771f89fac7083de32ef2b0 Mon Sep 17 00:00:00 2001 From: Abit Date: Sat, 20 Jan 2018 16:54:09 +0100 Subject: [PATCH] static_variant::set_which() rejects negative param --- include/fc/static_variant.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/fc/static_variant.hpp b/include/fc/static_variant.hpp index d6206c2..688d4b9 100644 --- a/include/fc/static_variant.hpp +++ b/include/fc/static_variant.hpp @@ -327,6 +327,7 @@ public: static int count() { return impl::type_info::count; } void set_which( int w ) { + FC_ASSERT( w >= 0 ); FC_ASSERT( w < count() ); this->~static_variant(); _tag = w;