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

Consider null terminator when using malloc #91

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Conversation

TomaSajt
Copy link
Contributor

@TomaSajt TomaSajt commented Nov 21, 2023

I was trying to package this program for Nixpkgs, and used its custom meson builder script, which uses some kind of fortification by default, which catches buffer overflows.

When running the program I got several buffer overflow errors, and with the help of coredumpctl I could trace it back to some string size math. It looks like there wasn't enough space for the null-terminator of the string.

@TomaSajt TomaSajt force-pushed the master branch 2 times, most recently from b62600c to 477c036 Compare November 21, 2023 22:31
Copy link
Owner

@robiot robiot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool

@robiot
Copy link
Owner

robiot commented Nov 22, 2023

Thanks, looks like I missed that when allocating memory. I will merge this so you can package it for nixpkg!

@robiot robiot merged commit c99f69a into robiot:master Nov 22, 2023
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

Successfully merging this pull request may close these issues.

2 participants