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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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:701:2: Loop condition is false. Leaving loop
    699.   	es->err_file[es->top]=file;
    700.   	es->err_line[es->top]=line;
    701.   	err_clear_data(es,es->top);
            ^
    702.   	}
    703.   

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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:701:2: Loop condition is false. Leaving loop
    699.   	es->err_file[es->top]=file;
    700.   	es->err_line[es->top]=line;
    701.   	err_clear_data(es,es->top);
            ^
    702.   	}
    703.   

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

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

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

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

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

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