Skip to content
Snippets Groups Projects
Commit 64ad6f9a authored by dmitriy.gerasimov's avatar dmitriy.gerasimov
Browse files

Merge branch 'feature-2963' into 'master'

added the checks for null pointer

See merge request !12
parents 14ad232a 7b700cdc
No related branches found
No related tags found
1 merge request!12added the checks for null pointer
......@@ -253,6 +253,8 @@ size_t dap_chain_wallet_get_certs_number( dap_chain_wallet_t * a_wallet)
*/
dap_enc_key_t* dap_chain_wallet_get_key( dap_chain_wallet_t * a_wallet,uint32_t a_pkey_idx )
{
if(!a_wallet)
return NULL;
DAP_CHAIN_WALLET_INTERNAL_LOCAL(a_wallet);
if( l_wallet_internal->certs_count > a_pkey_idx ){
return l_wallet_internal->certs[a_pkey_idx] ?
......
......@@ -64,7 +64,7 @@ typedef struct dap_chain_wallet_internal
dap_cert_t ** certs;
} dap_chain_wallet_internal_t;
#define DAP_CHAIN_WALLET_INTERNAL(a) ((dap_chain_wallet_internal_t *) a->_internal )
#define DAP_CHAIN_WALLET_INTERNAL(a) (a ? (dap_chain_wallet_internal_t *) a->_internal : NULL)
#define DAP_CHAIN_WALLET_INTERNAL_LOCAL(a) dap_chain_wallet_internal_t * l_wallet_internal = DAP_CHAIN_WALLET_INTERNAL(a)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment