engines/e_sureware.c:692: error: NULL_DEREFERENCE
  pointer `dsatmp` last assigned on line 691 could be null and is dereferenced by call to `DSA_set_ex_data()` at line 692, column 3.
Showing all 38 steps of the trace


engines/e_sureware.c:635:1: start of procedure sureware_load_public()
633.   }
634.   
635. > static EVP_PKEY* sureware_load_public(ENGINE *e,const char *key_id,char *hptr,unsigned long el,char keytype)
636.   {
637.   	EVP_PKEY *res = NULL;

engines/e_sureware.c:637:2: 
635.   static EVP_PKEY* sureware_load_public(ENGINE *e,const char *key_id,char *hptr,unsigned long el,char keytype)
636.   {
637. > 	EVP_PKEY *res = NULL;
638.   #ifndef OPENSSL_NO_RSA
639.   	RSA *rsatmp = NULL;

engines/e_sureware.c:639:2: 
637.   	EVP_PKEY *res = NULL;
638.   #ifndef OPENSSL_NO_RSA
639. > 	RSA *rsatmp = NULL;
640.   #endif
641.   #ifndef OPENSSL_NO_DSA

engines/e_sureware.c:642:2: 
640.   #endif
641.   #ifndef OPENSSL_NO_DSA
642. > 	DSA *dsatmp=NULL;
643.   #endif
644.   	char msg[64]="sureware_load_public";

engines/e_sureware.c:644:2: 
642.   	DSA *dsatmp=NULL;
643.   #endif
644. > 	char msg[64]="sureware_load_public";
645.   	int ret=0;
646.   	if(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)

engines/e_sureware.c:645:2: 
643.   #endif
644.   	char msg[64]="sureware_load_public";
645. > 	int ret=0;
646.   	if(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)
647.   	{

engines/e_sureware.c:646:6: Taking false branch
644.   	char msg[64]="sureware_load_public";
645.   	int ret=0;
646.   	if(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)
            ^
647.   	{
648.   		SUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_NOT_INITIALISED);

engines/e_sureware.c:646:39: Taking false branch
644.   	char msg[64]="sureware_load_public";
645.   	int ret=0;
646.   	if(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)
                                             ^
647.   	{
648.   		SUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_NOT_INITIALISED);

engines/e_sureware.c:651:2: 
649.   		goto err;
650.   	}
651. > 	switch (keytype)
652.   	{
653.   #ifndef OPENSSL_NO_RSA

engines/e_sureware.c:654:2: Switch condition is false. Skipping switch case
652.   	{
653.   #ifndef OPENSSL_NO_RSA
654.   	case 1: /*RSA*/
        ^
655.   		/* set private external reference */
656.   		rsatmp = RSA_new_method(e);

engines/e_sureware.c:689:2: Switch condition is true. Entering switch case
687.   
688.   #ifndef OPENSSL_NO_DSA
689.   	case 2:/*DSA*/
        ^
690.   		/* set private/public external reference */
691.   		dsatmp = DSA_new_method(e);

engines/e_sureware.c:691:3: 
689.   	case 2:/*DSA*/
690.   		/* set private/public external reference */
691. > 		dsatmp = DSA_new_method(e);
692.   		DSA_set_ex_data(dsatmp,dsaHndidx,hptr);
693.   		/*dsatmp->flags |= DSA_FLAG_EXT_PKEY;*/

crypto/dsa/dsa_lib.c:106:1: start of procedure DSA_new_method()
  104.   	}
  105.   
  106. > DSA *DSA_new_method(ENGINE *engine)
  107.   	{
  108.   	DSA *ret;

crypto/dsa/dsa_lib.c:110:2: 
  108.   	DSA *ret;
  109.   
  110. > 	ret=(DSA *)OPENSSL_malloc(sizeof(DSA));
  111.   	if (ret == NULL)
  112.   		{

crypto/mem.c:289:1: start of procedure CRYPTO_malloc()
    287.   	}
    288.   
    289. > void *CRYPTO_malloc(int num, const char *file, int line)
    290.   	{
    291.   	void *ret = NULL;

crypto/mem.c:291:2: 
    289.   void *CRYPTO_malloc(int num, const char *file, int line)
    290.   	{
    291. > 	void *ret = NULL;
    292.   	extern unsigned char cleanse_ctr;
    293.   

crypto/mem.c:294:2: 
    292.   	extern unsigned char cleanse_ctr;
    293.   
    294. > 	allow_customize = 0;
    295.   	if (malloc_debug_func != NULL)
    296.   		{

crypto/mem.c:295:6: Taking false branch
    293.   
    294.   	allow_customize = 0;
    295.   	if (malloc_debug_func != NULL)
                ^
    296.   		{
    297.   		allow_customize_debug = 0;

crypto/mem.c:300:2: Skipping __function_pointer__(): unresolved function pointer
    298.   		malloc_debug_func(NULL, num, file, line, 0);
    299.   		}
    300.   	ret = malloc_ex_func(num,file,line);
            ^
    301.   #ifdef LEVITTE_DEBUG_MEM
    302.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:304:6: Taking false branch
    302.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
    303.   #endif
    304.   	if (malloc_debug_func != NULL)
                ^
    305.   		malloc_debug_func(ret, num, file, line, 1);
    306.   

crypto/mem.c:310:12: Taking false branch
    308.            * sanitisation function can't be optimised out. NB: We only do
    309.            * this for >2Kb so the overhead doesn't bother us. */
    310.           if(ret && (num > 2048))
                      ^
    311.                   ((unsigned char *)ret)[0] = cleanse_ctr;
    312.   

crypto/mem.c:313:2: 
    311.                   ((unsigned char *)ret)[0] = cleanse_ctr;
    312.   
    313. > 	return ret;
    314.   	}
    315.   

crypto/mem.c:314:2: return from a call to CRYPTO_malloc
    312.   
    313.   	return ret;
    314.   	}
            ^
    315.   
    316.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/dsa/dsa_lib.c:111:6: Taking true branch
  109.   
  110.   	ret=(DSA *)OPENSSL_malloc(sizeof(DSA));
  111.   	if (ret == NULL)
              ^
  112.   		{
  113.   		DSAerr(DSA_F_DSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);

crypto/dsa/dsa_lib.c:113:3: 
  111.   	if (ret == NULL)
  112.   		{
  113. > 		DSAerr(DSA_F_DSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);
  114.   		return(NULL);
  115.   		}

crypto/err/err.c:617:1: start of procedure ERR_put_error()
    615.   /********************************************************/
    616.   
    617. > void ERR_put_error(int lib, int func, int reason, const char *file,
    618.   	     int line)
    619.   	{

crypto/err/err.c:641:2: Skipping ERR_get_state(): empty list of specs
    639.   	}
    640.   #endif
    641.   	es=ERR_get_state();
            ^
    642.   
    643.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:643:2: 
    641.   	es=ERR_get_state();
    642.   
    643. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    644.   	if (es->top == es->bottom)
    645.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:644:6: Taking false branch
    642.   
    643.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    644.   	if (es->top == es->bottom)
                ^
    645.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    646.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:646:2: 
    644.   	if (es->top == es->bottom)
    645.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    646. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    647.   	es->err_file[es->top]=file;
    648.   	es->err_line[es->top]=line;

crypto/err/err.c:647:2: 
    645.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    646.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    647. > 	es->err_file[es->top]=file;
    648.   	es->err_line[es->top]=line;
    649.   	err_clear_data(es,es->top);

crypto/err/err.c:648:2: 
    646.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    647.   	es->err_file[es->top]=file;
    648. > 	es->err_line[es->top]=line;
    649.   	err_clear_data(es,es->top);
    650.   	}

crypto/err/err.c:649:2: Taking true branch
    647.   	es->err_file[es->top]=file;
    648.   	es->err_line[es->top]=line;
    649.   	err_clear_data(es,es->top);
            ^
    650.   	}
    651.   

crypto/err/err.c:649:2: Taking false branch
    647.   	es->err_file[es->top]=file;
    648.   	es->err_line[es->top]=line;
    649.   	err_clear_data(es,es->top);
            ^
    650.   	}
    651.   

crypto/err/err.c:650:2: return from a call to ERR_put_error
    648.   	es->err_line[es->top]=line;
    649.   	err_clear_data(es,es->top);
    650.   	}
            ^
    651.   
    652.   void ERR_clear_error(void)

crypto/dsa/dsa_lib.c:114:3: 
  112.   		{
  113.   		DSAerr(DSA_F_DSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);
  114. > 		return(NULL);
  115.   		}
  116.   	ret->meth = DSA_get_default_method();

crypto/dsa/dsa_lib.c:169:2: return from a call to DSA_new_method
  167.   	
  168.   	return(ret);
  169.   	}
          ^
  170.   
  171.   void DSA_free(DSA *r)

engines/e_sureware.c:692:3: 
690.   		/* set private/public external reference */
691.   		dsatmp = DSA_new_method(e);
692. > 		DSA_set_ex_data(dsatmp,dsaHndidx,hptr);
693.   		/*dsatmp->flags |= DSA_FLAG_EXT_PKEY;*/
694.   
