From 64c1b51241b4a368af007e1484a9e52162d7238e Mon Sep 17 00:00:00 2001 From: Benedikt Date: Thu, 12 Oct 2023 15:24:26 +0200 Subject: [PATCH] arg check overflow --- src/modules/schnorrsig/main_impl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/schnorrsig/main_impl.h b/src/modules/schnorrsig/main_impl.h index c37452d43..c443ed688 100644 --- a/src/modules/schnorrsig/main_impl.h +++ b/src/modules/schnorrsig/main_impl.h @@ -298,6 +298,7 @@ int secp256k1_schnorrsig_inc_aggregate(const secp256k1_context *ctx, unsigned ch /* Check that aggsig_size is large enough, i.e. aggsig_size >= 32*(n+1) */ n = n_before + n_new; + ARG_CHECK(n >= n_before); if ((*aggsig_size / 32) <= 0 || ((*aggsig_size / 32)-1) < n) { return 0; }