Skip to content

Commit

Permalink
Avoid potential corruption: unpack(static_variant)
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed Oct 1, 2023
1 parent 33cd59c commit 2d73734
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/fc/io/raw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,8 +889,9 @@ namespace fc {
--_max_depth;
unsigned_int w;
fc::raw::unpack( s, w, _max_depth );
sv.set_which(w.value);
sv.visit( unpack_static_variant<Stream>( s, _max_depth ) );
static_variant<T...> helper( static_cast<typename static_variant<T...>::tag_type>(w.value) );
helper.visit( unpack_static_variant<Stream>( s, _max_depth ) );
sv = helper;
}

} } // namespace fc::raw
Expand Down

0 comments on commit 2d73734

Please sign in to comment.