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

Writing behind the allocated memory #26

Open
jernst opened this issue Sep 21, 2019 · 1 comment
Open

Writing behind the allocated memory #26

jernst opened this issue Sep 21, 2019 · 1 comment

Comments

@jernst
Copy link

jernst commented Sep 21, 2019

Code excerpt:

input = vmalloc(len);
...
input[len] = '\0';

From

input = vmalloc(len);

That should be:

input = vmalloc(len+1);
...
input[len] = '\0';
@ju2wheels
Copy link
Contributor

This seems oddly similar to my thoughts on #15 wrt to the null character being added to the output on read but I dont write enough C to chase it down.

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

2 participants