From 02a45166102305e34d968077baa54a8b8ba903a9 Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Tue, 21 Aug 2018 16:48:00 +0200 Subject: [PATCH] Handle b<0 --- include/fc/io/raw.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp index fb3abb7..c12abb1 100644 --- a/include/fc/io/raw.hpp +++ b/include/fc/io/raw.hpp @@ -172,7 +172,7 @@ namespace fc { uint64_t v = 0; char b = 0; uint8_t by = 0; do { s.get(b); - if( by >= 64 || (by == 63 && b > 1) ) + if( by >= 64 || (by == 63 && uint8_t(b) > 1) ) FC_THROW_EXCEPTION( overflow_exception, "Invalid packed unsigned_int!" ); v |= uint64_t(uint8_t(b) & 0x7f) << by; by += 7;