You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

wasmparser

Package Overview
Dependencies
Maintainers
0
Versions
270
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wasmparser - cargo Package Compare versions

Comparing version
0.239.0
to
0.240.0
+1
-1
.cargo_vcs_info.json
{
"git": {
"sha1": "35f8671bce74190ef0b00ce36c399b053b490374"
"sha1": "dafe42f8f543ca76429d5ef7b5e84f41ae8e73fe"
},
"path_in_vcs": "crates/wasmparser"
}

@@ -507,6 +507,7 @@ # This file is automatically @generated by Cargo.

name = "serde"
version = "1.0.219"
version = "1.0.222"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
checksum = "aab69e3f5be1836a1fe0aca0b286e5a5b38f262d6c9e8acd2247818751fcc8fb"
dependencies = [
"serde_core",
"serde_derive",

@@ -516,6 +517,15 @@ ]

[[package]]
name = "serde_core"
version = "1.0.222"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f8ebec5eea07db7df9342aa712db2138f019d9ab3454a60a680579a6f841b80"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.219"
version = "1.0.222"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
checksum = "b5f61630fe26d0ff555e6c37dc445ab2f15871c8a11ace3cf471b3195d3e4f49"
dependencies = [

@@ -584,3 +594,3 @@ "proc-macro2",

name = "wasmparser"
version = "0.239.0"
version = "0.240.0"
dependencies = [

@@ -587,0 +597,0 @@ "anyhow",

@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

name = "wasmparser"
version = "0.239.0"
version = "0.240.0"
authors = ["Yury Delendik <ydelendik@mozilla.com>"]

@@ -19,0 +19,0 @@ build = "build.rs"

@@ -20,2 +20,4 @@ /* Copyright 2017 Mozilla Foundation

// The limits are agreed upon with other engines for consistency.
//
// See https://webassembly.github.io/spec/js-api/#limits for details.
pub const MAX_WASM_TYPES: usize = 1_000_000;

@@ -30,3 +32,3 @@ pub const MAX_WASM_SUPERTYPES: usize = 1;

pub const MAX_WASM_STRING_SIZE: usize = 100_000;
pub const MAX_WASM_FUNCTION_SIZE: usize = 128 * 1024;
pub const MAX_WASM_FUNCTION_SIZE: usize = 7_654_321;
pub const MAX_WASM_FUNCTION_LOCALS: u32 = 50000;

@@ -33,0 +35,0 @@ pub const MAX_WASM_FUNCTION_PARAMS: usize = 1000;

@@ -96,3 +96,3 @@ use crate::prelude::*;

fn from_reader(reader: &mut BinaryReader<'a>) -> Result<Self> {
let name = reader.read_string()?;
let name = reader.read_unlimited_string()?;
let alignment = reader.read_var_u32()?;

@@ -147,3 +147,3 @@ let flags = reader.read()?;

fn from_reader(reader: &mut BinaryReader<'a>) -> Result<Self> {
let name = reader.read_string()?;
let name = reader.read_unlimited_string()?;
let flags = reader.read_var_u32()?;

@@ -304,3 +304,3 @@ // FIXME(#188) ideally shouldn't need to skip here

let name = match defined || explicit_name {
true => Some(reader.read_string()?),
true => Some(reader.read_unlimited_string()?),
false => None,

@@ -317,3 +317,3 @@ };

SYMTAB_DATA => {
let name = reader.read_string()?;
let name = reader.read_unlimited_string()?;
let data = match defined {

@@ -320,0 +320,0 @@ true => Some(reader.read()?),

@@ -1009,2 +1009,10 @@ /* Copyright 2018 Mozilla Foundation

self.state.ensure_module("code", offset)?;
check_max(
0,
u32::try_from(body.range().len())
.expect("usize already validated to u32 during section-length decoding"),
MAX_WASM_FUNCTION_SIZE,
"function body size",
offset,
)?;

@@ -1011,0 +1019,0 @@ let state = self.module.as_mut().unwrap();

@@ -35,1 +35,29 @@ use std::borrow::Cow;

}
#[test]
fn big_function_body() {
let mut module = Module::new();
let mut types = TypeSection::new();
types.ty().function([], []);
module.section(&types);
let mut funcs = FunctionSection::new();
funcs.function(0);
module.section(&funcs);
let mut code = CodeSection::new();
let mut body = Function::new([]);
// Function body larger than the 7_654_321-byte implementation
// limit.
for _ in 0..8_000_000 {
body.instructions().unreachable();
}
body.instructions().end();
code.function(&body);
module.section(&code);
let wasm = module.finish();
let result = wasmparser::Validator::default().validate_all(&wasm);
assert!(result.is_err());
}

Sorry, the diff of this file is too big to display