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

Augeas: Improve Handling of Large Files #3332

Open
sanssecours opened this issue Dec 11, 2019 · 1 comment
Open

Augeas: Improve Handling of Large Files #3332

sanssecours opened this issue Dec 11, 2019 · 1 comment

Comments

@sanssecours
Copy link
Member

@sanssecours sanssecours commented Dec 11, 2019

Description

Currently the Augeas plugin uses the function ftell to retrieve the size of a file:

long fileSize = ftell (fh);

. Afterwards the plugin uses elektraMalloc to allocate memory for the file content:

content = elektraMalloc (fileSize * sizeof (char) + 1);

. The problem with this approach is that the maximum value of the type long returned by ftell (LONG_MAX) might be larger than the maximum possible size_t value (SIZE_MAX). In this case the plugin code might not store the whole content of the file and hence not work correctly.

For more information about this problem, please take a look here.

@markus2330

This comment has been minimized.

Copy link
Contributor

@markus2330 markus2330 commented Jan 14, 2020

Thank you for reporting the potential problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.