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

handle null-byte case in scanformat (fixes #1105) #1106

Merged
merged 2 commits into from
Apr 22, 2023

Commits on Apr 19, 2023

  1. check for NULL in get_fmt_mapping (fixes janet-lang#1105)

    When there is no format to be found after a %, get_fmt_mapping returns
    NULL. It then gets called against strlen, which is a typical SEGV.
    Check for NULL aginst mapping, which signals a null format being
    specified.
    CosmicToast committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    f319230 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2023

  1. improve null format handling

    there was a request to improve the error message, but the whole function
    has non-informative errors. (both functions, actually, since the code is
    duplicated)
    as such, instead of catching it directly, address the assumption that
    led to the SIGSEGV and let it be caught by the functions themselves,
    thus reusing existing error messages (which can then be improved
    separately).
    CosmicToast committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    0902a5a View commit details
    Browse the repository at this point in the history