From 4c53c579578155ac347b841d07497604d23ed02a Mon Sep 17 00:00:00 2001 From: Gary Lockyer Date: Wed, 6 Aug 2025 13:00:32 +1200 Subject: [PATCH] s4:kdc:db-glue talloc steal pub_key data talloc_steal the data pointers of pub_key, modulus and exponent onto pub_key. To allow fuzz testing of ndr_pull_KeyMaterialInternal the KeyMaterialInternal struct may not be a talloc_context. So the data portions will be allocated on the ndr context. Signed-off-by: Gary Lockyer Reviewed-by: Douglas Bagnall --- source4/kdc/db-glue.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source4/kdc/db-glue.c b/source4/kdc/db-glue.c index f3e8bd9073c..a776dc008e6 100644 --- a/source4/kdc/db-glue.c +++ b/source4/kdc/db-glue.c @@ -1305,6 +1305,11 @@ static krb5_error_code unpack_key_credential_link_blob( TALLOC_FREE(*pub_key); goto out; } + /* + * Steal modulus and exponent data from the ndr context onto the pub_key + */ + talloc_steal(*pub_key, (*pub_key)->modulus.data); + talloc_steal(*pub_key, (*pub_key)->exponent.data); out: TALLOC_FREE(tmp_ctx); -- 2.47.2