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


crypto/objects/obj_dat.c:438:1: start of procedure OBJ_obj2txt()
436.   	}
437.   
438. > int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
439.   {
440.   	int i,n=0,len,nid, first, use_bn;

crypto/objects/obj_dat.c:440:2: 
438.   int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
439.   {
440. > 	int i,n=0,len,nid, first, use_bn;
441.   	BIGNUM *bl;
442.   	unsigned long l;

crypto/objects/obj_dat.c:446:7: Taking false branch
444.   	char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];
445.   
446.   	if ((a == NULL) || (a->data == NULL)) {
             ^
447.   		buf[0]='\0';
448.   		return(0);

crypto/objects/obj_dat.c:446:22: Taking false branch
444.   	char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];
445.   
446.   	if ((a == NULL) || (a->data == NULL)) {
                            ^
447.   		buf[0]='\0';
448.   		return(0);

crypto/objects/obj_dat.c:452:7: Taking true branch
450.   
451.   
452.   	if (!no_name && (nid=OBJ_obj2nid(a)) != NID_undef)
             ^
453.   		{
454.   		const char *s;

crypto/objects/obj_dat.c:452:18: 
450.   
451.   
452. > 	if (!no_name && (nid=OBJ_obj2nid(a)) != NID_undef)
453.   		{
454.   		const char *s;

crypto/objects/obj_dat.c:369:1: start of procedure OBJ_obj2nid()
  367.   	}
  368.   
  369. > int OBJ_obj2nid(const ASN1_OBJECT *a)
  370.   	{
  371.   	ASN1_OBJECT **op;

crypto/objects/obj_dat.c:374:6: Taking false branch
  372.   	ADDED_OBJ ad,*adp;
  373.   
  374.   	if (a == NULL)
              ^
  375.   		return(NID_undef);
  376.   	if (a->nid != 0)

crypto/objects/obj_dat.c:376:6: Taking true branch
  374.   	if (a == NULL)
  375.   		return(NID_undef);
  376.   	if (a->nid != 0)
              ^
  377.   		return(a->nid);
  378.   

crypto/objects/obj_dat.c:377:3: 
  375.   		return(NID_undef);
  376.   	if (a->nid != 0)
  377. > 		return(a->nid);
  378.   
  379.   	if (added != NULL)

crypto/objects/obj_dat.c:391:2: return from a call to OBJ_obj2nid
  389.   		return(NID_undef);
  390.   	return((*op)->nid);
  391.   	}
          ^
  392.   
  393.   /* Convert an object name into an ASN1_OBJECT

crypto/objects/obj_dat.c:452:18: Taking true branch
450.   
451.   
452.   	if (!no_name && (nid=OBJ_obj2nid(a)) != NID_undef)
                        ^
453.   		{
454.   		const char *s;

crypto/objects/obj_dat.c:455:3: 
453.   		{
454.   		const char *s;
455. > 		s=OBJ_nid2ln(nid);
456.   		if (s == NULL)
457.   			s=OBJ_nid2sn(nid);

crypto/objects/obj_dat.c:337:1: start of procedure OBJ_nid2ln()
  335.   	}
  336.   
  337. > const char *OBJ_nid2ln(int n)
  338.   	{
  339.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:342:7: Taking true branch
  340.   	ASN1_OBJECT ob;
  341.   
  342.   	if ((n >= 0) && (n < NUM_NID))
               ^
  343.   		{
  344.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:342:19: Taking true branch
  340.   	ASN1_OBJECT ob;
  341.   
  342.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  343.   		{
  344.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:344:8: Taking true branch
  342.   	if ((n >= 0) && (n < NUM_NID))
  343.   		{
  344.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                ^
  345.   			{
  346.   			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:344:28: Taking true branch
  342.   	if ((n >= 0) && (n < NUM_NID))
  343.   		{
  344.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                    ^
  345.   			{
  346.   			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:346:4: 
  344.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
  345.   			{
  346. > 			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);
  347.   			return(NULL);
  348.   			}

crypto/err/err.c:666:1: start of procedure ERR_put_error()
    664.   /********************************************************/
    665.   
    666. > void ERR_put_error(int lib, int func, int reason, const char *file,
    667.   	     int line)
    668.   	{

crypto/err/err.c:690:2: Skipping ERR_get_state(): empty list of specs
    688.   	}
    689.   #endif
    690.   	es=ERR_get_state();
            ^
    691.   
    692.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:692:2: 
    690.   	es=ERR_get_state();
    691.   
    692. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    693.   	if (es->top == es->bottom)
    694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:693:6: Taking false branch
    691.   
    692.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    693.   	if (es->top == es->bottom)
                ^
    694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    695.   	es->err_flags[es->top]=0;

crypto/err/err.c:695:2: 
    693.   	if (es->top == es->bottom)
    694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    695. > 	es->err_flags[es->top]=0;
    696.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    697.   	es->err_file[es->top]=file;

crypto/err/err.c:696:2: 
    694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    695.   	es->err_flags[es->top]=0;
    696. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    697.   	es->err_file[es->top]=file;
    698.   	es->err_line[es->top]=line;

crypto/err/err.c:697:2: 
    695.   	es->err_flags[es->top]=0;
    696.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    697. > 	es->err_file[es->top]=file;
    698.   	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);

crypto/err/err.c:698:2: 
    696.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    697.   	es->err_file[es->top]=file;
    698. > 	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);
    700.   	}

crypto/err/err.c:699:2: Taking true branch
    697.   	es->err_file[es->top]=file;
    698.   	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);
            ^
    700.   	}
    701.   

crypto/err/err.c:699:2: Taking true branch
    697.   	es->err_file[es->top]=file;
    698.   	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);
            ^
    700.   	}
    701.   

crypto/mem.c:371:1: start of procedure CRYPTO_free()
      369.   	}
      370.   
      371. > void CRYPTO_free(void *str)
      372.   	{
      373.   	if (free_debug_func != NULL)

crypto/mem.c:373:6: Taking true branch
      371.   void CRYPTO_free(void *str)
      372.   	{
      373.   	if (free_debug_func != NULL)
                  ^
      374.   		free_debug_func(str, 0);
      375.   #ifdef LEVITTE_DEBUG_MEM

crypto/mem.c:374:3: Skipping __function_pointer__(): unresolved function pointer
      372.   	{
      373.   	if (free_debug_func != NULL)
      374.   		free_debug_func(str, 0);
               ^
      375.   #ifdef LEVITTE_DEBUG_MEM
      376.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);

crypto/mem.c:378:2: Skipping __function_pointer__(): unresolved function pointer
      376.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);
      377.   #endif
      378.   	free_func(str);
              ^
      379.   	if (free_debug_func != NULL)
      380.   		free_debug_func(NULL, 1);

crypto/mem.c:379:6: Taking true branch
      377.   #endif
      378.   	free_func(str);
      379.   	if (free_debug_func != NULL)
                  ^
      380.   		free_debug_func(NULL, 1);
      381.   	}

crypto/mem.c:380:3: Skipping __function_pointer__(): unresolved function pointer
      378.   	free_func(str);
      379.   	if (free_debug_func != NULL)
      380.   		free_debug_func(NULL, 1);
               ^
      381.   	}
      382.   

crypto/mem.c:379:2: 
      377.   #endif
      378.   	free_func(str);
      379. > 	if (free_debug_func != NULL)
      380.   		free_debug_func(NULL, 1);
      381.   	}

crypto/mem.c:381:2: return from a call to CRYPTO_free
      379.   	if (free_debug_func != NULL)
      380.   		free_debug_func(NULL, 1);
      381.   	}
              ^
      382.   
      383.   void *CRYPTO_remalloc(void *a, int num, const char *file, int line)

crypto/err/err.c:699:2: Loop condition is false. Leaving loop
    697.   	es->err_file[es->top]=file;
    698.   	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);
            ^
    700.   	}
    701.   

crypto/err/err.c:700:2: return from a call to ERR_put_error
    698.   	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);
    700.   	}
            ^
    701.   
    702.   void ERR_clear_error(void)

crypto/objects/obj_dat.c:347:4: 
  345.   			{
  346.   			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);
  347. > 			return(NULL);
  348.   			}
  349.   		return(nid_objs[n].ln);

crypto/objects/obj_dat.c:367:2: return from a call to OBJ_nid2ln
  365.   			}
  366.   		}
  367.   	}
          ^
  368.   
  369.   int OBJ_obj2nid(const ASN1_OBJECT *a)

crypto/objects/obj_dat.c:456:7: Taking true branch
454.   		const char *s;
455.   		s=OBJ_nid2ln(nid);
456.   		if (s == NULL)
             ^
457.   			s=OBJ_nid2sn(nid);
458.   		if (buf)

crypto/objects/obj_dat.c:457:4: 
455.   		s=OBJ_nid2ln(nid);
456.   		if (s == NULL)
457. > 			s=OBJ_nid2sn(nid);
458.   		if (buf)
459.   			BUF_strlcpy(buf,s,buf_len);

crypto/objects/obj_dat.c:305:1: start of procedure OBJ_nid2sn()
  303.   	}
  304.   
  305. > const char *OBJ_nid2sn(int n)
  306.   	{
  307.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:310:7: Taking true branch
  308.   	ASN1_OBJECT ob;
  309.   
  310.   	if ((n >= 0) && (n < NUM_NID))
               ^
  311.   		{
  312.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:310:19: Taking true branch
  308.   	ASN1_OBJECT ob;
  309.   
  310.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  311.   		{
  312.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:312:8: Taking true branch
  310.   	if ((n >= 0) && (n < NUM_NID))
  311.   		{
  312.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                ^
  313.   			{
  314.   			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:312:28: Taking true branch
  310.   	if ((n >= 0) && (n < NUM_NID))
  311.   		{
  312.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                    ^
  313.   			{
  314.   			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:314:4: 
  312.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
  313.   			{
  314. > 			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);
  315.   			return(NULL);
  316.   			}

crypto/err/err.c:666:1: start of procedure ERR_put_error()
    664.   /********************************************************/
    665.   
    666. > void ERR_put_error(int lib, int func, int reason, const char *file,
    667.   	     int line)
    668.   	{

crypto/err/err.c:690:2: Skipping ERR_get_state(): empty list of specs
    688.   	}
    689.   #endif
    690.   	es=ERR_get_state();
            ^
    691.   
    692.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:692:2: 
    690.   	es=ERR_get_state();
    691.   
    692. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    693.   	if (es->top == es->bottom)
    694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:693:6: Taking false branch
    691.   
    692.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    693.   	if (es->top == es->bottom)
                ^
    694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    695.   	es->err_flags[es->top]=0;

crypto/err/err.c:695:2: 
    693.   	if (es->top == es->bottom)
    694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    695. > 	es->err_flags[es->top]=0;
    696.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    697.   	es->err_file[es->top]=file;

crypto/err/err.c:696:2: 
    694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    695.   	es->err_flags[es->top]=0;
    696. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    697.   	es->err_file[es->top]=file;
    698.   	es->err_line[es->top]=line;

crypto/err/err.c:697:2: 
    695.   	es->err_flags[es->top]=0;
    696.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    697. > 	es->err_file[es->top]=file;
    698.   	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);

crypto/err/err.c:698:2: 
    696.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    697.   	es->err_file[es->top]=file;
    698. > 	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);
    700.   	}

crypto/err/err.c:699:2: Taking true branch
    697.   	es->err_file[es->top]=file;
    698.   	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);
            ^
    700.   	}
    701.   

crypto/err/err.c:699:2: Taking true branch
    697.   	es->err_file[es->top]=file;
    698.   	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);
            ^
    700.   	}
    701.   

crypto/mem.c:371:1: start of procedure CRYPTO_free()
      369.   	}
      370.   
      371. > void CRYPTO_free(void *str)
      372.   	{
      373.   	if (free_debug_func != NULL)

crypto/mem.c:373:6: Taking true branch
      371.   void CRYPTO_free(void *str)
      372.   	{
      373.   	if (free_debug_func != NULL)
                  ^
      374.   		free_debug_func(str, 0);
      375.   #ifdef LEVITTE_DEBUG_MEM

crypto/mem.c:374:3: Skipping __function_pointer__(): unresolved function pointer
      372.   	{
      373.   	if (free_debug_func != NULL)
      374.   		free_debug_func(str, 0);
               ^
      375.   #ifdef LEVITTE_DEBUG_MEM
      376.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);

crypto/mem.c:378:2: Skipping __function_pointer__(): unresolved function pointer
      376.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);
      377.   #endif
      378.   	free_func(str);
              ^
      379.   	if (free_debug_func != NULL)
      380.   		free_debug_func(NULL, 1);

crypto/mem.c:379:6: Taking true branch
      377.   #endif
      378.   	free_func(str);
      379.   	if (free_debug_func != NULL)
                  ^
      380.   		free_debug_func(NULL, 1);
      381.   	}

crypto/mem.c:380:3: Skipping __function_pointer__(): unresolved function pointer
      378.   	free_func(str);
      379.   	if (free_debug_func != NULL)
      380.   		free_debug_func(NULL, 1);
               ^
      381.   	}
      382.   

crypto/mem.c:379:2: 
      377.   #endif
      378.   	free_func(str);
      379. > 	if (free_debug_func != NULL)
      380.   		free_debug_func(NULL, 1);
      381.   	}

crypto/mem.c:381:2: return from a call to CRYPTO_free
      379.   	if (free_debug_func != NULL)
      380.   		free_debug_func(NULL, 1);
      381.   	}
              ^
      382.   
      383.   void *CRYPTO_remalloc(void *a, int num, const char *file, int line)

crypto/err/err.c:699:2: Loop condition is false. Leaving loop
    697.   	es->err_file[es->top]=file;
    698.   	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);
            ^
    700.   	}
    701.   

crypto/err/err.c:700:2: return from a call to ERR_put_error
    698.   	es->err_line[es->top]=line;
    699.   	err_clear_data(es,es->top);
    700.   	}
            ^
    701.   
    702.   void ERR_clear_error(void)

crypto/objects/obj_dat.c:315:4: 
  313.   			{
  314.   			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);
  315. > 			return(NULL);
  316.   			}
  317.   		return(nid_objs[n].sn);

crypto/objects/obj_dat.c:335:2: return from a call to OBJ_nid2sn
  333.   			}
  334.   		}
  335.   	}
          ^
  336.   
  337.   const char *OBJ_nid2ln(int n)

crypto/objects/obj_dat.c:458:7: Taking true branch
456.   		if (s == NULL)
457.   			s=OBJ_nid2sn(nid);
458.   		if (buf)
             ^
459.   			BUF_strlcpy(buf,s,buf_len);
460.   		n=strlen(s);

crypto/objects/obj_dat.c:459:4: Skipping BUF_strlcpy(): empty list of specs
457.   			s=OBJ_nid2sn(nid);
458.   		if (buf)
459.   			BUF_strlcpy(buf,s,buf_len);
          ^
460.   		n=strlen(s);
461.   		return n;

crypto/objects/obj_dat.c:460:3: 
458.   		if (buf)
459.   			BUF_strlcpy(buf,s,buf_len);
460. > 		n=strlen(s);
461.   		return n;
462.   		}
