Skip to content

Potential Unsound Issue when dealing with ZST #1

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

Open
CXWorks opened this issue May 11, 2025 · 0 comments
Open

Potential Unsound Issue when dealing with ZST #1

CXWorks opened this issue May 11, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@CXWorks
Copy link

CXWorks commented May 11, 2025

Describe the bug
Hi, thanks for your time. Our static analyzer finds the PageVec doesn't check for ZST as element.

To Reproduce
Please run folloiwng poc:

use memory_pages::PagedVec;

#[derive(Debug)]
struct A;
fn main() {
    let mut vec = PagedVec::<A>::new(0);
    vec.reserve(1000);
    println!("{:?}", vec.len());
}

Expected behavior
Program executed and exit with 0.

For crashes
Failed to check for ZST, leading to divides by 0 error

OS version
N/A

Additional context
N/A

@CXWorks CXWorks added the bug Something isn't working label May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant