crypto/dsa/dsa_lib.c:208: error: NULL_DEREFERENCE
  pointer `meth` last assigned on line 207 could be null and is dereferenced at line 208, column 5.
Showing all 28 steps of the trace


crypto/dsa/dsa_lib.c:187:1: start of procedure DSA_free()
185.   	}
186.   
187. > void DSA_free(DSA *r)
188.   	{
189.   	const DSA_METHOD *meth;

crypto/dsa/dsa_lib.c:192:6: Taking false branch
190.   	int i;
191.   
192.   	if (r == NULL) return;
            ^
193.   
194.   	i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_DSA);

crypto/dsa/dsa_lib.c:194:2: 
192.   	if (r == NULL) return;
193.   
194. > 	i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_DSA);
195.   #ifdef REF_PRINT
196.   	REF_PRINT("DSA",r);

crypto/cryptlib.c:415:1: start of procedure CRYPTO_add_lock()
  413.   	}
  414.   
  415. > int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
  416.   	     int line)
  417.   	{

crypto/cryptlib.c:418:2: 
  416.   	     int line)
  417.   	{
  418. > 	int ret = 0;
  419.   
  420.   	if (add_lock_callback != NULL)

crypto/cryptlib.c:420:6: Taking true branch
  418.   	int ret = 0;
  419.   
  420.   	if (add_lock_callback != NULL)
              ^
  421.   		{
  422.   #ifdef LOCK_DEBUG

crypto/cryptlib.c:426:3: Skipping __function_pointer__(): unresolved function pointer
  424.   #endif
  425.   
  426.   		ret=add_lock_callback(pointer,amount,type,file,line);
           ^
  427.   #ifdef LOCK_DEBUG
  428.   		fprintf(stderr,"ladd:%08lx:%2d+%2d->%2d %-18s %s:%d\n",

crypto/cryptlib.c:434:3: 
  432.   			file,line);
  433.   #endif
  434. > 		*pointer=ret;
  435.   		}
  436.   	else

crypto/cryptlib.c:451:2: 
  449.   		CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,file,line);
  450.   		}
  451. > 	return(ret);
  452.   	}
  453.   

crypto/cryptlib.c:452:2: return from a call to CRYPTO_add_lock
  450.   		}
  451.   	return(ret);
  452.   	}
          ^
  453.   
  454.   const char *CRYPTO_get_lock_name(int type)

crypto/dsa/dsa_lib.c:198:6: Taking false branch
196.   	REF_PRINT("DSA",r);
197.   #endif
198.   	if (i > 0) return;
            ^
199.   #ifdef REF_CHECK
200.   	if (i < 0)

crypto/dsa/dsa_lib.c:207:2: 
205.   #endif
206.   
207. > 	meth = ENGINE_get_DSA(r->engine);
208.   	if(meth->finish) meth->finish(r);
209.   	ENGINE_finish(r->engine);

crypto/engine/engine_list.c:574:1: start of procedure ENGINE_get_DSA()
  572.   	}
  573.   
  574. > const DSA_METHOD *ENGINE_get_DSA(ENGINE *e)
  575.   	{
  576.   	if(e == NULL)

crypto/engine/engine_list.c:576:5: Taking true branch
  574.   const DSA_METHOD *ENGINE_get_DSA(ENGINE *e)
  575.   	{
  576.   	if(e == NULL)
             ^
  577.   		{
  578.   		ENGINEerr(ENGINE_F_ENGINE_GET_DSA,

crypto/engine/engine_list.c:578:3: 
  576.   	if(e == NULL)
  577.   		{
  578. > 		ENGINEerr(ENGINE_F_ENGINE_GET_DSA,
  579.   			ERR_R_PASSED_NULL_PARAMETER);
  580.   		return NULL;

crypto/err/err.c:355:1: start of procedure ERR_put_error()
    353.   /********************************************************/
    354.   
    355. > void ERR_put_error(int lib, int func, int reason, const char *file,
    356.   	     int line)
    357.   	{

crypto/err/err.c:379:2: Skipping ERR_get_state(): empty list of specs
    377.   	}
    378.   #endif
    379.   	es=ERR_get_state();
            ^
    380.   
    381.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:381:2: 
    379.   	es=ERR_get_state();
    380.   
    381. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    382.   	if (es->top == es->bottom)
    383.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:382:6: Taking false branch
    380.   
    381.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    382.   	if (es->top == es->bottom)
                ^
    383.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    384.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:384:2: 
    382.   	if (es->top == es->bottom)
    383.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    384. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    385.   	es->err_file[es->top]=file;
    386.   	es->err_line[es->top]=line;

crypto/err/err.c:385:2: 
    383.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    384.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    385. > 	es->err_file[es->top]=file;
    386.   	es->err_line[es->top]=line;
    387.   	err_clear_data(es,es->top);

crypto/err/err.c:386:2: 
    384.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    385.   	es->err_file[es->top]=file;
    386. > 	es->err_line[es->top]=line;
    387.   	err_clear_data(es,es->top);
    388.   	}

crypto/err/err.c:387:2: Taking true branch
    385.   	es->err_file[es->top]=file;
    386.   	es->err_line[es->top]=line;
    387.   	err_clear_data(es,es->top);
            ^
    388.   	}
    389.   

crypto/err/err.c:387:2: Taking false branch
    385.   	es->err_file[es->top]=file;
    386.   	es->err_line[es->top]=line;
    387.   	err_clear_data(es,es->top);
            ^
    388.   	}
    389.   

crypto/err/err.c:388:2: return from a call to ERR_put_error
    386.   	es->err_line[es->top]=line;
    387.   	err_clear_data(es,es->top);
    388.   	}
            ^
    389.   
    390.   void ERR_clear_error(void)

crypto/engine/engine_list.c:580:3: 
  578.   		ENGINEerr(ENGINE_F_ENGINE_GET_DSA,
  579.   			ERR_R_PASSED_NULL_PARAMETER);
  580. > 		return NULL;
  581.   		}
  582.   	return e->dsa_meth;

crypto/engine/engine_list.c:583:2: return from a call to ENGINE_get_DSA
  581.   		}
  582.   	return e->dsa_meth;
  583.   	}
          ^
  584.   
  585.   const DH_METHOD *ENGINE_get_DH(ENGINE *e)

crypto/dsa/dsa_lib.c:208:5: Taking false branch
206.   
207.   	meth = ENGINE_get_DSA(r->engine);
208.   	if(meth->finish) meth->finish(r);
           ^
209.   	ENGINE_finish(r->engine);
210.   

void DSA_free(DSA *r)
	{
	const DSA_METHOD *meth;
	int i;
	if (r == NULL) return;
	i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_DSA);
#ifdef REF_PRINT
	REF_PRINT("DSA",r);
#endif
	if (i > 0) return;
#ifdef REF_CHECK
	if (i < 0)
		{
		fprintf(stderr,"DSA_free, bad reference count\n");
		abort();
		}
#endif
	meth = ENGINE_get_DSA(r->engine);
	if(meth->finish) meth->finish(r);
	ENGINE_finish(r->engine);
	CRYPTO_free_ex_data(dsa_meth, r, &r->ex_data);
	if (r->p != NULL) BN_clear_free(r->p);
	if (r->q != NULL) BN_clear_free(r->q);
	if (r->g != NULL) BN_clear_free(r->g);
	if (r->pub_key != NULL) BN_clear_free(r->pub_key);
	if (r->priv_key != NULL) BN_clear_free(r->priv_key);
	if (r->kinv != NULL) BN_clear_free(r->kinv);
	if (r->r != NULL) BN_clear_free(r->r);
	OPENSSL_free(r);
	}
['void DSA_free(DSA *r)\n\t{\n\tconst DSA_METHOD *meth;\n\tint i;\n\tif (r == NULL) return;\n\ti=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_DSA);\n#ifdef REF_PRINT\n\tREF_PRINT("DSA",r);\n#endif\n\tif (i > 0) return;\n#ifdef REF_CHECK\n\tif (i < 0)\n\t\t{\n\t\tfprintf(stderr,"DSA_free, bad reference count\\n");\n\t\tabort();\n\t\t}\n#endif\n\tmeth = ENGINE_get_DSA(r->engine);\n\tif(meth->finish) meth->finish(r);\n\tENGINE_finish(r->engine);\n\tCRYPTO_free_ex_data(dsa_meth, r, &r->ex_data);\n\tif (r->p != NULL) BN_clear_free(r->p);\n\tif (r->q != NULL) BN_clear_free(r->q);\n\tif (r->g != NULL) BN_clear_free(r->g);\n\tif (r->pub_key != NULL) BN_clear_free(r->pub_key);\n\tif (r->priv_key != NULL) BN_clear_free(r->priv_key);\n\tif (r->kinv != NULL) BN_clear_free(r->kinv);\n\tif (r->r != NULL) BN_clear_free(r->r);\n\tOPENSSL_free(r);\n\t}', 'int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,\n\t     int line)\n\t{\n\tint ret = 0;\n\tif (add_lock_callback != NULL)\n\t\t{\n#ifdef LOCK_DEBUG\n\t\tint before= *pointer;\n#endif\n\t\tret=add_lock_callback(pointer,amount,type,file,line);\n#ifdef LOCK_DEBUG\n\t\tfprintf(stderr,"ladd:%08lx:%2d+%2d->%2d %-18s %s:%d\\n",\n\t\t\tCRYPTO_thread_id(),\n\t\t\tbefore,amount,ret,\n\t\t\tCRYPTO_get_lock_name(type),\n\t\t\tfile,line);\n#endif\n\t\t*pointer=ret;\n\t\t}\n\telse\n\t\t{\n\t\tCRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,file,line);\n\t\tret= *pointer+amount;\n#ifdef LOCK_DEBUG\n\t\tfprintf(stderr,"ladd:%08lx:%2d+%2d->%2d %-18s %s:%d\\n",\n\t\t\tCRYPTO_thread_id(),\n\t\t\t*pointer,amount,ret,\n\t\t\tCRYPTO_get_lock_name(type),\n\t\t\tfile,line);\n#endif\n\t\t*pointer=ret;\n\t\tCRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,file,line);\n\t\t}\n\treturn(ret);\n\t}', 'const DSA_METHOD *ENGINE_get_DSA(ENGINE *e)\n\t{\n\tif(e == NULL)\n\t\t{\n\t\tENGINEerr(ENGINE_F_ENGINE_GET_DSA,\n\t\t\tERR_R_PASSED_NULL_PARAMETER);\n\t\treturn NULL;\n\t\t}\n\treturn e->dsa_meth;\n\t}', 'void ERR_put_error(int lib, int func, int reason, const char *file,\n\t     int line)\n\t{\n\tERR_STATE *es;\n#ifdef _OSD_POSIX\n\tif (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) {\n\t\tchar *end;\n\t\tfile += sizeof("*POSIX(")-1;\n\t\tend = &file[strlen(file)-1];\n\t\tif (*end == \')\')\n\t\t\t*end = \'\\0\';\n\t\tif ((end = strrchr(file, \'/\')) != NULL)\n\t\t\tfile = &end[1];\n\t}\n#endif\n\tes=ERR_get_state();\n\tes->top=(es->top+1)%ERR_NUM_ERRORS;\n\tif (es->top == es->bottom)\n\t\tes->bottom=(es->bottom+1)%ERR_NUM_ERRORS;\n\tes->err_buffer[es->top]=ERR_PACK(lib,func,reason);\n\tes->err_file[es->top]=file;\n\tes->err_line[es->top]=line;\n\terr_clear_data(es,es->top);\n\t}']