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

Segmentation fault triggered via printf #1105

Closed
sogaiu opened this issue Apr 18, 2023 · 2 comments
Closed

Segmentation fault triggered via printf #1105

sogaiu opened this issue Apr 18, 2023 · 2 comments

Comments

@sogaiu
Copy link
Contributor

sogaiu commented Apr 18, 2023

I mistyped a format string and got a segfault:

$ janet
Janet 1.27.0-bef5bd72 linux/x64/gcc - '(doc)' for help
repl:1:> (printf "hello %" `dave`)
Segmentation fault (core dumped)
@pepe
Copy link
Member

pepe commented Apr 18, 2023

I can confirm the behavior observed on Alpine with musl.

@CosmicToast
Copy link
Contributor

This is an unchecked strlen against a null pointer in scanformat.
I've submitted a fix.

bakpakin added a commit that referenced this issue Apr 22, 2023
handle null-byte case in scanformat (fixes #1105)
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

3 participants