From: Gary Lockyer Date: Wed, 6 Aug 2025 01:00:32 +0000 (+1200) Subject: s4:kdc:db-glue talloc steal pub_key data X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c53c579578155ac347b841d07497604d23ed02a;p=thirdparty%2Fsamba.git 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 --- 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);