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

Need to zero allocations before use. #10

Open
ahknight opened this issue Aug 7, 2014 · 0 comments
Open

Need to zero allocations before use. #10

ahknight opened this issue Aug 7, 2014 · 0 comments

Comments

@ahknight
Copy link

ahknight commented Aug 7, 2014

Currently CS uses malloc() to allocate memory. This allocation is not zeroed and old data resides there. While most operations will succeed and overwrite the data, the best practice (especially in a security class) is to use calloc() instead to zero out the allocation before use.

malloc(1024) -> calloc(1024,1)

http://www.diffen.com/difference/Calloc_vs_Malloc#Security_considerations
http://stackoverflow.com/questions/8029584/why-does-malloc-initialize-the-values-to-0-in-gcc

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

1 participant