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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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