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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

crypto/err/err.c:680:1: start of procedure ERR_put_error()
    678.   /********************************************************/
    679.   
    680. > void ERR_put_error(int lib, int func, int reason, const char *file,
    681.   	     int line)
    682.   	{

crypto/err/err.c:704:2: Skipping ERR_get_state(): empty list of specs
    702.   	}
    703.   #endif
    704.   	es=ERR_get_state();
            ^
    705.   
    706.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:706:2: 
    704.   	es=ERR_get_state();
    705.   
    706. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    707.   	if (es->top == es->bottom)
    708.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:707:6: Taking false branch
    705.   
    706.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    707.   	if (es->top == es->bottom)
                ^
    708.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    709.   	es->err_flags[es->top]=0;

crypto/err/err.c:709:2: 
    707.   	if (es->top == es->bottom)
    708.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    709. > 	es->err_flags[es->top]=0;
    710.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    711.   	es->err_file[es->top]=file;

crypto/err/err.c:710:2: 
    708.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    709.   	es->err_flags[es->top]=0;
    710. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    711.   	es->err_file[es->top]=file;
    712.   	es->err_line[es->top]=line;

crypto/err/err.c:711:2: 
    709.   	es->err_flags[es->top]=0;
    710.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    711. > 	es->err_file[es->top]=file;
    712.   	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);

crypto/err/err.c:712:2: 
    710.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    711.   	es->err_file[es->top]=file;
    712. > 	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);
    714.   	}

crypto/err/err.c:713:2: Taking true branch
    711.   	es->err_file[es->top]=file;
    712.   	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);
            ^
    714.   	}
    715.   

crypto/err/err.c:713:2: Taking true branch
    711.   	es->err_file[es->top]=file;
    712.   	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);
            ^
    714.   	}
    715.   

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:713:2: Loop condition is false. Leaving loop
    711.   	es->err_file[es->top]=file;
    712.   	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);
            ^
    714.   	}
    715.   

crypto/err/err.c:714:2: return from a call to ERR_put_error
    712.   	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);
    714.   	}
            ^
    715.   
    716.   void ERR_clear_error(void)

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

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

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

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

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

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

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

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

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

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

crypto/err/err.c:680:1: start of procedure ERR_put_error()
    678.   /********************************************************/
    679.   
    680. > void ERR_put_error(int lib, int func, int reason, const char *file,
    681.   	     int line)
    682.   	{

crypto/err/err.c:704:2: Skipping ERR_get_state(): empty list of specs
    702.   	}
    703.   #endif
    704.   	es=ERR_get_state();
            ^
    705.   
    706.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:706:2: 
    704.   	es=ERR_get_state();
    705.   
    706. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    707.   	if (es->top == es->bottom)
    708.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:707:6: Taking false branch
    705.   
    706.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    707.   	if (es->top == es->bottom)
                ^
    708.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    709.   	es->err_flags[es->top]=0;

crypto/err/err.c:709:2: 
    707.   	if (es->top == es->bottom)
    708.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    709. > 	es->err_flags[es->top]=0;
    710.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    711.   	es->err_file[es->top]=file;

crypto/err/err.c:710:2: 
    708.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    709.   	es->err_flags[es->top]=0;
    710. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    711.   	es->err_file[es->top]=file;
    712.   	es->err_line[es->top]=line;

crypto/err/err.c:711:2: 
    709.   	es->err_flags[es->top]=0;
    710.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    711. > 	es->err_file[es->top]=file;
    712.   	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);

crypto/err/err.c:712:2: 
    710.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    711.   	es->err_file[es->top]=file;
    712. > 	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);
    714.   	}

crypto/err/err.c:713:2: Taking true branch
    711.   	es->err_file[es->top]=file;
    712.   	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);
            ^
    714.   	}
    715.   

crypto/err/err.c:713:2: Taking true branch
    711.   	es->err_file[es->top]=file;
    712.   	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);
            ^
    714.   	}
    715.   

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:713:2: Loop condition is false. Leaving loop
    711.   	es->err_file[es->top]=file;
    712.   	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);
            ^
    714.   	}
    715.   

crypto/err/err.c:714:2: return from a call to ERR_put_error
    712.   	es->err_line[es->top]=line;
    713.   	err_clear_data(es,es->top);
    714.   	}
            ^
    715.   
    716.   void ERR_clear_error(void)

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

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

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

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

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