Skip to content

Commit e3550eb

Browse files
jonasnickdeadalnix
authored andcommitted
Make the secp256k1_declassify argument constant
Summary: This is required to declassify pointers to constant memory. Declassify should never modify its argument. This is a partial backport of secp256k1 [[bitcoin-core/secp256k1#558 | PR558]] : bitcoin-core/secp256k1@3e08b02 Test Plan: ninja check-secp256k1 Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7636
1 parent b96288b commit e3550eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/secp256k1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ void secp256k1_scratch_space_destroy(const secp256k1_context *ctx, secp256k1_scr
227227
* of the software. This is setup for use with valgrind but could be substituted with
228228
* the appropriate instrumentation for other analysis tools.
229229
*/
230-
static SECP256K1_INLINE void secp256k1_declassify(const secp256k1_context* ctx, void *p, size_t len) {
230+
static SECP256K1_INLINE void secp256k1_declassify(const secp256k1_context* ctx, const void *p, size_t len) {
231231
#if defined(VALGRIND)
232232
if (EXPECT(ctx->declassify,0)) VALGRIND_MAKE_MEM_DEFINED(p, len);
233233
#else

0 commit comments

Comments
 (0)