Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panicked at 'assertion failed: self.is_char_boundary(new_len)' #872

Open
WIZeaz opened this issue Oct 16, 2023 · 0 comments
Open

Panicked at 'assertion failed: self.is_char_boundary(new_len)' #872

WIZeaz opened this issue Oct 16, 2023 · 0 comments

Comments

@WIZeaz
Copy link

WIZeaz commented Oct 16, 2023

Hi,
I'm using a fuzz tool to test this repo, and my fuzzer report a panic about char boundary. The repo version is 1.2.0.

use std::string::String;
use form_urlencoded::Serializer;
fn foo(){
    let s=String::from("é0");
    let mut serializer= Serializer::for_suffix(s, 1);
    let _ = serializer.clear();
}

this code snippet will cause a char boundary panic:

thread 'main' panicked at 'assertion failed: self.is_char_boundary(new_len)', /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc\library\alloc\src\string.rs:1279:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant