crypto/objects/obj_dat.c:479: error: NULL_DEREFERENCE
  pointer `s` last assigned on line 476 could be null and is dereferenced by call to `strlen()` at line 479, column 5.
Showing all 74 steps of the trace


crypto/objects/obj_dat.c:457:1: start of procedure OBJ_obj2txt()
455.   	}
456.   
457. > int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
458.   {
459.   	int i,n=0,len,nid, first, use_bn;

crypto/objects/obj_dat.c:459:2: 
457.   int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
458.   {
459. > 	int i,n=0,len,nid, first, use_bn;
460.   	BIGNUM *bl;
461.   	unsigned long l;

crypto/objects/obj_dat.c:465:7: Taking false branch
463.   	char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];
464.   
465.   	if ((a == NULL) || (a->data == NULL)) {
             ^
466.   		buf[0]='\0';
467.   		return(0);

crypto/objects/obj_dat.c:465:22: Taking false branch
463.   	char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];
464.   
465.   	if ((a == NULL) || (a->data == NULL)) {
                            ^
466.   		buf[0]='\0';
467.   		return(0);

crypto/objects/obj_dat.c:471:7: Taking true branch
469.   
470.   
471.   	if (!no_name && (nid=OBJ_obj2nid(a)) != NID_undef)
             ^
472.   		{
473.   		const char *s;

crypto/objects/obj_dat.c:471:18: 
469.   
470.   
471. > 	if (!no_name && (nid=OBJ_obj2nid(a)) != NID_undef)
472.   		{
473.   		const char *s;

crypto/objects/obj_dat.c:388:1: start of procedure OBJ_obj2nid()
  386.   	}
  387.   
  388. > int OBJ_obj2nid(const ASN1_OBJECT *a)
  389.   	{
  390.   	const unsigned int *op;

crypto/objects/obj_dat.c:393:6: Taking false branch
  391.   	ADDED_OBJ ad,*adp;
  392.   
  393.   	if (a == NULL)
              ^
  394.   		return(NID_undef);
  395.   	if (a->nid != 0)

crypto/objects/obj_dat.c:395:6: Taking true branch
  393.   	if (a == NULL)
  394.   		return(NID_undef);
  395.   	if (a->nid != 0)
              ^
  396.   		return(a->nid);
  397.   

crypto/objects/obj_dat.c:396:3: 
  394.   		return(NID_undef);
  395.   	if (a->nid != 0)
  396. > 		return(a->nid);
  397.   
  398.   	if (added != NULL)

crypto/objects/obj_dat.c:410:2: return from a call to OBJ_obj2nid
  408.   		return(NID_undef);
  409.   	return(nid_objs[*op].nid);
  410.   	}
          ^
  411.   
  412.   /* Convert an object name into an ASN1_OBJECT

crypto/objects/obj_dat.c:471:18: Taking true branch
469.   
470.   
471.   	if (!no_name && (nid=OBJ_obj2nid(a)) != NID_undef)
                        ^
472.   		{
473.   		const char *s;

crypto/objects/obj_dat.c:474:3: 
472.   		{
473.   		const char *s;
474. > 		s=OBJ_nid2ln(nid);
475.   		if (s == NULL)
476.   			s=OBJ_nid2sn(nid);

crypto/objects/obj_dat.c:356:1: start of procedure OBJ_nid2ln()
  354.   	}
  355.   
  356. > const char *OBJ_nid2ln(int n)
  357.   	{
  358.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:361:7: Taking true branch
  359.   	ASN1_OBJECT ob;
  360.   
  361.   	if ((n >= 0) && (n < NUM_NID))
               ^
  362.   		{
  363.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:361:19: Taking true branch
  359.   	ASN1_OBJECT ob;
  360.   
  361.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  362.   		{
  363.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:363:8: Taking true branch
  361.   	if ((n >= 0) && (n < NUM_NID))
  362.   		{
  363.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                ^
  364.   			{
  365.   			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:363:28: Taking true branch
  361.   	if ((n >= 0) && (n < NUM_NID))
  362.   		{
  363.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                    ^
  364.   			{
  365.   			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:365:4: 
  363.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
  364.   			{
  365. > 			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);
  366.   			return(NULL);
  367.   			}

crypto/err/err.c:706:1: start of procedure ERR_put_error()
    704.   /********************************************************/
    705.   
    706. > void ERR_put_error(int lib, int func, int reason, const char *file,
    707.   	     int line)
    708.   	{

crypto/err/err.c:730:2: Skipping ERR_get_state(): empty list of specs
    728.   	}
    729.   #endif
    730.   	es=ERR_get_state();
            ^
    731.   
    732.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:732:2: 
    730.   	es=ERR_get_state();
    731.   
    732. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    733.   	if (es->top == es->bottom)
    734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:733:6: Taking false branch
    731.   
    732.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    733.   	if (es->top == es->bottom)
                ^
    734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    735.   	es->err_flags[es->top]=0;

crypto/err/err.c:735:2: 
    733.   	if (es->top == es->bottom)
    734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    735. > 	es->err_flags[es->top]=0;
    736.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    737.   	es->err_file[es->top]=file;

crypto/err/err.c:736:2: 
    734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    735.   	es->err_flags[es->top]=0;
    736. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    737.   	es->err_file[es->top]=file;
    738.   	es->err_line[es->top]=line;

crypto/err/err.c:737:2: 
    735.   	es->err_flags[es->top]=0;
    736.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    737. > 	es->err_file[es->top]=file;
    738.   	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);

crypto/err/err.c:738:2: 
    736.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    737.   	es->err_file[es->top]=file;
    738. > 	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);
    740.   	}

crypto/err/err.c:739:2: Taking true branch
    737.   	es->err_file[es->top]=file;
    738.   	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);
            ^
    740.   	}
    741.   

crypto/err/err.c:739:2: Taking true branch
    737.   	es->err_file[es->top]=file;
    738.   	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);
            ^
    740.   	}
    741.   

crypto/mem.c:377:1: start of procedure CRYPTO_free()
      375.   	}
      376.   
      377. > void CRYPTO_free(void *str)
      378.   	{
      379.   	if (free_debug_func != NULL)

crypto/mem.c:379:6: Taking true branch
      377.   void CRYPTO_free(void *str)
      378.   	{
      379.   	if (free_debug_func != NULL)
                  ^
      380.   		free_debug_func(str, 0);
      381.   #ifdef LEVITTE_DEBUG_MEM

crypto/mem.c:380:3: Skipping __function_pointer__(): unresolved function pointer
      378.   	{
      379.   	if (free_debug_func != NULL)
      380.   		free_debug_func(str, 0);
               ^
      381.   #ifdef LEVITTE_DEBUG_MEM
      382.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);

crypto/mem.c:384:2: Skipping __function_pointer__(): unresolved function pointer
      382.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);
      383.   #endif
      384.   	free_func(str);
              ^
      385.   	if (free_debug_func != NULL)
      386.   		free_debug_func(NULL, 1);

crypto/mem.c:385:6: Taking true branch
      383.   #endif
      384.   	free_func(str);
      385.   	if (free_debug_func != NULL)
                  ^
      386.   		free_debug_func(NULL, 1);
      387.   	}

crypto/mem.c:386:3: Skipping __function_pointer__(): unresolved function pointer
      384.   	free_func(str);
      385.   	if (free_debug_func != NULL)
      386.   		free_debug_func(NULL, 1);
               ^
      387.   	}
      388.   

crypto/mem.c:385:2: 
      383.   #endif
      384.   	free_func(str);
      385. > 	if (free_debug_func != NULL)
      386.   		free_debug_func(NULL, 1);
      387.   	}

crypto/mem.c:387:2: return from a call to CRYPTO_free
      385.   	if (free_debug_func != NULL)
      386.   		free_debug_func(NULL, 1);
      387.   	}
              ^
      388.   
      389.   void *CRYPTO_remalloc(void *a, int num, const char *file, int line)

crypto/err/err.c:739:2: Loop condition is false. Leaving loop
    737.   	es->err_file[es->top]=file;
    738.   	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);
            ^
    740.   	}
    741.   

crypto/err/err.c:740:2: return from a call to ERR_put_error
    738.   	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);
    740.   	}
            ^
    741.   
    742.   void ERR_clear_error(void)

crypto/objects/obj_dat.c:366:4: 
  364.   			{
  365.   			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);
  366. > 			return(NULL);
  367.   			}
  368.   		return(nid_objs[n].ln);

crypto/objects/obj_dat.c:386:2: return from a call to OBJ_nid2ln
  384.   			}
  385.   		}
  386.   	}
          ^
  387.   
  388.   int OBJ_obj2nid(const ASN1_OBJECT *a)

crypto/objects/obj_dat.c:475:7: Taking true branch
473.   		const char *s;
474.   		s=OBJ_nid2ln(nid);
475.   		if (s == NULL)
             ^
476.   			s=OBJ_nid2sn(nid);
477.   		if (buf)

crypto/objects/obj_dat.c:476:4: 
474.   		s=OBJ_nid2ln(nid);
475.   		if (s == NULL)
476. > 			s=OBJ_nid2sn(nid);
477.   		if (buf)
478.   			BUF_strlcpy(buf,s,buf_len);

crypto/objects/obj_dat.c:324:1: start of procedure OBJ_nid2sn()
  322.   	}
  323.   
  324. > const char *OBJ_nid2sn(int n)
  325.   	{
  326.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:329:7: Taking true branch
  327.   	ASN1_OBJECT ob;
  328.   
  329.   	if ((n >= 0) && (n < NUM_NID))
               ^
  330.   		{
  331.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:329:19: Taking true branch
  327.   	ASN1_OBJECT ob;
  328.   
  329.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  330.   		{
  331.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:331:8: Taking true branch
  329.   	if ((n >= 0) && (n < NUM_NID))
  330.   		{
  331.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                ^
  332.   			{
  333.   			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:331:28: Taking true branch
  329.   	if ((n >= 0) && (n < NUM_NID))
  330.   		{
  331.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                    ^
  332.   			{
  333.   			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:333:4: 
  331.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
  332.   			{
  333. > 			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);
  334.   			return(NULL);
  335.   			}

crypto/err/err.c:706:1: start of procedure ERR_put_error()
    704.   /********************************************************/
    705.   
    706. > void ERR_put_error(int lib, int func, int reason, const char *file,
    707.   	     int line)
    708.   	{

crypto/err/err.c:730:2: Skipping ERR_get_state(): empty list of specs
    728.   	}
    729.   #endif
    730.   	es=ERR_get_state();
            ^
    731.   
    732.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:732:2: 
    730.   	es=ERR_get_state();
    731.   
    732. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    733.   	if (es->top == es->bottom)
    734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:733:6: Taking false branch
    731.   
    732.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    733.   	if (es->top == es->bottom)
                ^
    734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    735.   	es->err_flags[es->top]=0;

crypto/err/err.c:735:2: 
    733.   	if (es->top == es->bottom)
    734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    735. > 	es->err_flags[es->top]=0;
    736.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    737.   	es->err_file[es->top]=file;

crypto/err/err.c:736:2: 
    734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    735.   	es->err_flags[es->top]=0;
    736. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    737.   	es->err_file[es->top]=file;
    738.   	es->err_line[es->top]=line;

crypto/err/err.c:737:2: 
    735.   	es->err_flags[es->top]=0;
    736.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    737. > 	es->err_file[es->top]=file;
    738.   	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);

crypto/err/err.c:738:2: 
    736.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    737.   	es->err_file[es->top]=file;
    738. > 	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);
    740.   	}

crypto/err/err.c:739:2: Taking true branch
    737.   	es->err_file[es->top]=file;
    738.   	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);
            ^
    740.   	}
    741.   

crypto/err/err.c:739:2: Taking true branch
    737.   	es->err_file[es->top]=file;
    738.   	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);
            ^
    740.   	}
    741.   

crypto/mem.c:377:1: start of procedure CRYPTO_free()
      375.   	}
      376.   
      377. > void CRYPTO_free(void *str)
      378.   	{
      379.   	if (free_debug_func != NULL)

crypto/mem.c:379:6: Taking true branch
      377.   void CRYPTO_free(void *str)
      378.   	{
      379.   	if (free_debug_func != NULL)
                  ^
      380.   		free_debug_func(str, 0);
      381.   #ifdef LEVITTE_DEBUG_MEM

crypto/mem.c:380:3: Skipping __function_pointer__(): unresolved function pointer
      378.   	{
      379.   	if (free_debug_func != NULL)
      380.   		free_debug_func(str, 0);
               ^
      381.   #ifdef LEVITTE_DEBUG_MEM
      382.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);

crypto/mem.c:384:2: Skipping __function_pointer__(): unresolved function pointer
      382.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);
      383.   #endif
      384.   	free_func(str);
              ^
      385.   	if (free_debug_func != NULL)
      386.   		free_debug_func(NULL, 1);

crypto/mem.c:385:6: Taking true branch
      383.   #endif
      384.   	free_func(str);
      385.   	if (free_debug_func != NULL)
                  ^
      386.   		free_debug_func(NULL, 1);
      387.   	}

crypto/mem.c:386:3: Skipping __function_pointer__(): unresolved function pointer
      384.   	free_func(str);
      385.   	if (free_debug_func != NULL)
      386.   		free_debug_func(NULL, 1);
               ^
      387.   	}
      388.   

crypto/mem.c:385:2: 
      383.   #endif
      384.   	free_func(str);
      385. > 	if (free_debug_func != NULL)
      386.   		free_debug_func(NULL, 1);
      387.   	}

crypto/mem.c:387:2: return from a call to CRYPTO_free
      385.   	if (free_debug_func != NULL)
      386.   		free_debug_func(NULL, 1);
      387.   	}
              ^
      388.   
      389.   void *CRYPTO_remalloc(void *a, int num, const char *file, int line)

crypto/err/err.c:739:2: Loop condition is false. Leaving loop
    737.   	es->err_file[es->top]=file;
    738.   	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);
            ^
    740.   	}
    741.   

crypto/err/err.c:740:2: return from a call to ERR_put_error
    738.   	es->err_line[es->top]=line;
    739.   	err_clear_data(es,es->top);
    740.   	}
            ^
    741.   
    742.   void ERR_clear_error(void)

crypto/objects/obj_dat.c:334:4: 
  332.   			{
  333.   			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);
  334. > 			return(NULL);
  335.   			}
  336.   		return(nid_objs[n].sn);

crypto/objects/obj_dat.c:354:2: return from a call to OBJ_nid2sn
  352.   			}
  353.   		}
  354.   	}
          ^
  355.   
  356.   const char *OBJ_nid2ln(int n)

crypto/objects/obj_dat.c:477:7: Taking true branch
475.   		if (s == NULL)
476.   			s=OBJ_nid2sn(nid);
477.   		if (buf)
             ^
478.   			BUF_strlcpy(buf,s,buf_len);
479.   		n=strlen(s);

crypto/objects/obj_dat.c:478:4: Skipping BUF_strlcpy(): empty list of specs
476.   			s=OBJ_nid2sn(nid);
477.   		if (buf)
478.   			BUF_strlcpy(buf,s,buf_len);
          ^
479.   		n=strlen(s);
480.   		return n;

crypto/objects/obj_dat.c:479:3: 
477.   		if (buf)
478.   			BUF_strlcpy(buf,s,buf_len);
479. > 		n=strlen(s);
480.   		return n;
481.   		}
