diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index cdcfc0e7378e8..8fe891d9078dd 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -830,8 +830,8 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "WebAssembly for Proxies (C++ host implementation)", project_desc = "WebAssembly for Proxies (C++ host implementation)", project_url = "https://github.com/proxy-wasm/proxy-wasm-cpp-host", - version = "d54b3795e7c3e61015dac2c2110b0da2be999b8e", - sha256 = "e95ad57b6b550b039d4baa35c896f7f523e427b7278ba56f22fac6e1bef8c7f0", + version = "40fd3d03842c07d65fed907a6b6ed0f89d68d531", + sha256 = "b5ae746e66b6209ea0cce86d6c21de99dacbec1da9cdadd53a9ec46bc296a3ba", strip_prefix = "proxy-wasm-cpp-host-{version}", urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-host/archive/{version}.tar.gz"], use_category = ["dataplane_ext"], @@ -842,7 +842,7 @@ REPOSITORY_LOCATIONS_SPEC = dict( "envoy.filters.network.wasm", "envoy.stat_sinks.wasm", ], - release_date = "2020-10-22", + release_date = "2020-10-27", cpe = "N/A", ), emscripten_toolchain = dict( diff --git a/test/tools/wee8_compile/wee8_compile.cc b/test/tools/wee8_compile/wee8_compile.cc index 42cbfea08a18f..a1b2906ab281c 100644 --- a/test/tools/wee8_compile/wee8_compile.cc +++ b/test/tools/wee8_compile/wee8_compile.cc @@ -126,10 +126,22 @@ wasm::vec stripWasmModule(const wasm::vec& module) { std::cerr << "ERROR: Failed to parse corrupted Wasm module." << std::endl; return wasm::vec::invalid(); } - if (section_type != 0 /* custom section */) { - stripped.insert(stripped.end(), section_start, pos + section_len); + if (section_type == 0 /* custom section */) { + const auto section_data_start = pos; + const auto section_name_len = parseVarint(pos, end); + if (section_name_len == static_cast(-1) || pos + section_name_len > end) { + std::cerr << "ERROR: Failed to parse corrupted Wasm module." << std::endl; + return wasm::vec::invalid(); + } + auto section_name = std::string(pos, section_name_len); + if (section_name.find("precompiled_") == std::string::npos) { + stripped.insert(stripped.end(), section_start, section_data_start + section_len); + } + pos = section_data_start + section_len; + } else { + pos += section_len; + stripped.insert(stripped.end(), section_start, pos /* section end */); } - pos += section_len; } return wasm::vec::make(stripped.size(), stripped.data());