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

src/templ.rs: fix handling of C string slices #612

Merged
merged 1 commit into from
Sep 2, 2024

Commits on Sep 2, 2024

  1. src/templ.rs: fix handling of C string slices

    CommandLineParser is currently misbehaving due to improper data in
    its input argv parameter. The problem is caused by a blind cast of
    argv entries from &str into a C-like string, which does not offer the
    null termination guarantees. To fix that, create an actual CString
    and hold it while the pointer is in use.
    
    It's worth noting that the mutable version of the macro still relies
    on undefined behavior, but this time of CString which does not
    guarantee correctness if its data is written into.
    niemeyer committed Sep 2, 2024
    Configuration menu
    Copy the full SHA
    c8205ea View commit details
    Browse the repository at this point in the history