File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
2- "node_commit" : " 8385efc01343a835e3a0efe05611f44272cbb413 "
2+ "node_commit" : " e7da6f056ac4afeaaf012042188818ca7736f437 "
33}
Original file line number Diff line number Diff line change @@ -156,7 +156,12 @@ DataPointer DataPointer::SecureAlloc(size_t len) {
156156#ifndef OPENSSL_IS_BORINGSSL
157157 auto ptr = OPENSSL_secure_zalloc (len);
158158 if (ptr == nullptr ) return {};
159- return DataPointer (ptr, len, true );
159+ // OPENSSL_secure_zalloc transparently falls back to a regular allocation
160+ // when the secure heap is not initialized or is exhausted. Reflect the
161+ // actual provenance of the pointer so that reset() routes to the correct
162+ // free function (OPENSSL_secure_clear_free vs. OPENSSL_clear_free) and
163+ // callers of isSecure() get a truthful answer.
164+ return DataPointer (ptr, len, CRYPTO_secure_allocated (ptr) == 1 );
160165#else
161166 // BoringSSL does not implement the OPENSSL_secure_zalloc API.
162167 auto ptr = OPENSSL_malloc (len);
You can’t perform that action at this time.
0 commit comments