From 2900c265859fb4d7faaee41a4f1dc47b185ad4aa Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 22 Jun 2017 09:41:32 -0700 Subject: [PATCH] Fix narrowing in inflate_stream --- CHANGELOG.md | 1 + include/beast/zlib/detail/inflate_stream.hpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 302573c7..f94737c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Version 65: * Fix integer types in deflate_stream::bi_reverse * Fix narrowing in static_ostream * Fix narrowing in ostream +* Fix narrowing in inflate_stream -------------------------------------------------------------------------------- diff --git a/include/beast/zlib/detail/inflate_stream.hpp b/include/beast/zlib/detail/inflate_stream.hpp index 8f228508..33372786 100644 --- a/include/beast/zlib/detail/inflate_stream.hpp +++ b/include/beast/zlib/detail/inflate_stream.hpp @@ -1067,10 +1067,10 @@ get_fixed_tables() -> std::uint16_t lens[320]; std::uint16_t work[288]; - std::fill(&lens[ 0], &lens[144], 8); - std::fill(&lens[144], &lens[256], 9); - std::fill(&lens[256], &lens[280], 7); - std::fill(&lens[280], &lens[288], 8); + std::fill(&lens[ 0], &lens[144], std::uint16_t{8}); + std::fill(&lens[144], &lens[256], std::uint16_t{9}); + std::fill(&lens[256], &lens[280], std::uint16_t{7}); + std::fill(&lens[280], &lens[288], std::uint16_t{8}); { error_code ec; @@ -1090,7 +1090,7 @@ get_fixed_tables() -> { error_code ec; auto next = &dist_[0]; - std::fill(&lens[0], &lens[32], 5); + std::fill(&lens[0], &lens[32], std::uint16_t{5}); inflate_table(build::dists, lens, 32, &next, &distbits, work, ec); if(ec)