godaddy / godaddy/asherah

ALL: Finalize edge case memory leak potential in memory allocation

Open
#34 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
83
Forks
50
Avg merge
4d 8h
Merged PRs (30d)
7

Description

The C# `ProtectedMemorySecret` initialization has try/catch logic around the initial copying of the source data to handle edge case failures that could lead to memory leaks (not dealloc'ing). This seems like something that should be in the Java implementation as well. Additionally, there is an inconsistency in the aforementioned C# cleanup handling that is different than the regular cleanup/close path (not doing the pointer exchange).

We had untested changes around this that didn't make it into this public repo. We should normalize the approaches between the languages and update the Secure Memory documentation to reflect it accordingly. May be good opportunity to also verify whether the pointer exchanges are needed (if we're clearing/deallocating anyway).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.