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


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

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

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

crypto/objects/obj_dat.c:447:7: Taking false branch
445.   	if (buf_len <= 0) return(0);
446.   
447.   	if ((a == NULL) || (a->data == NULL)) {
             ^
448.   		buf[0]='\0';
449.   		return(0);

crypto/objects/obj_dat.c:447:22: Taking false branch
445.   	if (buf_len <= 0) return(0);
446.   
447.   	if ((a == NULL) || (a->data == NULL)) {
                            ^
448.   		buf[0]='\0';
449.   		return(0);

crypto/objects/obj_dat.c:452:6: Taking false branch
450.   	}
451.   
452.   	if (no_name || (nid=OBJ_obj2nid(a)) == NID_undef) {
            ^
453.   		len=a->length;
454.   		p=a->data;

crypto/objects/obj_dat.c:452:17: 
450.   	}
451.   
452. > 	if (no_name || (nid=OBJ_obj2nid(a)) == NID_undef) {
453.   		len=a->length;
454.   		p=a->data;

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

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

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

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

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

crypto/objects/obj_dat.c:452:17: Taking false branch
450.   	}
451.   
452.   	if (no_name || (nid=OBJ_obj2nid(a)) == NID_undef) {
                       ^
453.   		len=a->length;
454.   		p=a->data;

crypto/objects/obj_dat.c:492:3: 
490.   		}
491.   	} else {
492. > 		s=OBJ_nid2ln(nid);
493.   		if (s == NULL)
494.   			s=OBJ_nid2sn(nid);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

crypto/objects/obj_dat.c:493:7: Taking true branch
491.   	} else {
492.   		s=OBJ_nid2ln(nid);
493.   		if (s == NULL)
             ^
494.   			s=OBJ_nid2sn(nid);
495.   		BUF_strlcpy(buf,s,buf_len);

crypto/objects/obj_dat.c:494:4: 
492.   		s=OBJ_nid2ln(nid);
493.   		if (s == NULL)
494. > 			s=OBJ_nid2sn(nid);
495.   		BUF_strlcpy(buf,s,buf_len);
496.   		n=strlen(s);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

crypto/objects/obj_dat.c:495:3: Skipping BUF_strlcpy(): empty list of specs
493.   		if (s == NULL)
494.   			s=OBJ_nid2sn(nid);
495.   		BUF_strlcpy(buf,s,buf_len);
         ^
496.   		n=strlen(s);
497.   	}

crypto/objects/obj_dat.c:496:3: 
494.   			s=OBJ_nid2sn(nid);
495.   		BUF_strlcpy(buf,s,buf_len);
496. > 		n=strlen(s);
497.   	}
498.   	return(n);

int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
{
	int i,idx=0,n=0,len,nid;
	unsigned long l;
	unsigned char *p;
	const char *s;
	char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];
	if (buf_len <= 0) return(0);
	if ((a == NULL) || (a->data == NULL)) {
		buf[0]='\0';
		return(0);
	}
	if (no_name || (nid=OBJ_obj2nid(a)) == NID_undef) {
		len=a->length;
		p=a->data;
		idx=0;
		l=0;
		while (idx < a->length) {
			l|=(p[idx]&0x7f);
			if (!(p[idx] & 0x80)) break;
			l<<=7L;
			idx++;
		}
		idx++;
		i=(int)(l/40);
		if (i > 2) i=2;
		l-=(long)(i*40);
		BIO_snprintf(tbuf,sizeof tbuf,"%d.%lu",i,l);
		i=strlen(tbuf);
		BUF_strlcpy(buf,tbuf,buf_len);
		buf_len-=i;
		buf+=i;
		n+=i;
		l=0;
		for (; idx<len; idx++) {
			l|=p[idx]&0x7f;
			if (!(p[idx] & 0x80)) {
				BIO_snprintf(tbuf,sizeof tbuf,".%lu",l);
				i=strlen(tbuf);
				if (buf_len > 0)
					BUF_strlcpy(buf,tbuf,buf_len);
				buf_len-=i;
				buf+=i;
				n+=i;
				l=0;
			}
			l<<=7L;
		}
	} else {
		s=OBJ_nid2ln(nid);
		if (s == NULL)
			s=OBJ_nid2sn(nid);
		BUF_strlcpy(buf,s,buf_len);
		n=strlen(s);
	}
	return(n);
}
['int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)\n{\n\tint i,idx=0,n=0,len,nid;\n\tunsigned long l;\n\tunsigned char *p;\n\tconst char *s;\n\tchar tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];\n\tif (buf_len <= 0) return(0);\n\tif ((a == NULL) || (a->data == NULL)) {\n\t\tbuf[0]=\'\\0\';\n\t\treturn(0);\n\t}\n\tif (no_name || (nid=OBJ_obj2nid(a)) == NID_undef) {\n\t\tlen=a->length;\n\t\tp=a->data;\n\t\tidx=0;\n\t\tl=0;\n\t\twhile (idx < a->length) {\n\t\t\tl|=(p[idx]&0x7f);\n\t\t\tif (!(p[idx] & 0x80)) break;\n\t\t\tl<<=7L;\n\t\t\tidx++;\n\t\t}\n\t\tidx++;\n\t\ti=(int)(l/40);\n\t\tif (i > 2) i=2;\n\t\tl-=(long)(i*40);\n\t\tBIO_snprintf(tbuf,sizeof tbuf,"%d.%lu",i,l);\n\t\ti=strlen(tbuf);\n\t\tBUF_strlcpy(buf,tbuf,buf_len);\n\t\tbuf_len-=i;\n\t\tbuf+=i;\n\t\tn+=i;\n\t\tl=0;\n\t\tfor (; idx<len; idx++) {\n\t\t\tl|=p[idx]&0x7f;\n\t\t\tif (!(p[idx] & 0x80)) {\n\t\t\t\tBIO_snprintf(tbuf,sizeof tbuf,".%lu",l);\n\t\t\t\ti=strlen(tbuf);\n\t\t\t\tif (buf_len > 0)\n\t\t\t\t\tBUF_strlcpy(buf,tbuf,buf_len);\n\t\t\t\tbuf_len-=i;\n\t\t\t\tbuf+=i;\n\t\t\t\tn+=i;\n\t\t\t\tl=0;\n\t\t\t}\n\t\t\tl<<=7L;\n\t\t}\n\t} else {\n\t\ts=OBJ_nid2ln(nid);\n\t\tif (s == NULL)\n\t\t\ts=OBJ_nid2sn(nid);\n\t\tBUF_strlcpy(buf,s,buf_len);\n\t\tn=strlen(s);\n\t}\n\treturn(n);\n}', 'int OBJ_obj2nid(const ASN1_OBJECT *a)\n\t{\n\tASN1_OBJECT **op;\n\tADDED_OBJ ad,*adp;\n\tif (a == NULL)\n\t\treturn(NID_undef);\n\tif (a->nid != 0)\n\t\treturn(a->nid);\n\tif (added != NULL)\n\t\t{\n\t\tad.type=ADDED_DATA;\n\t\tad.obj=(ASN1_OBJECT *)a;\n\t\tadp=(ADDED_OBJ *)lh_retrieve(added,&ad);\n\t\tif (adp != NULL) return (adp->obj->nid);\n\t\t}\n\top=(ASN1_OBJECT **)OBJ_bsearch((char *)&a,(char *)obj_objs,NUM_OBJ,\n\t\tsizeof(ASN1_OBJECT *),obj_cmp);\n\tif (op == NULL)\n\t\treturn(NID_undef);\n\treturn((*op)->nid);\n\t}', 'const char *OBJ_nid2ln(int n)\n\t{\n\tADDED_OBJ ad,*adp;\n\tASN1_OBJECT ob;\n\tif ((n >= 0) && (n < NUM_NID))\n\t\t{\n\t\tif ((n != NID_undef) && (nid_objs[n].nid == NID_undef))\n\t\t\t{\n\t\t\tOBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);\n\t\t\treturn(NULL);\n\t\t\t}\n\t\treturn(nid_objs[n].ln);\n\t\t}\n\telse if (added == NULL)\n\t\treturn(NULL);\n\telse\n\t\t{\n\t\tad.type=ADDED_NID;\n\t\tad.obj= &ob;\n\t\tob.nid=n;\n\t\tadp=(ADDED_OBJ *)lh_retrieve(added,&ad);\n\t\tif (adp != NULL)\n\t\t\treturn(adp->obj->ln);\n\t\telse\n\t\t\t{\n\t\t\tOBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);\n\t\t\treturn(NULL);\n\t\t\t}\n\t\t}\n\t}', 'void ERR_put_error(int lib, int func, int reason, const char *file,\n\t     int line)\n\t{\n\tERR_STATE *es;\n#ifdef _OSD_POSIX\n\tif (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) {\n\t\tchar *end;\n\t\tfile += sizeof("*POSIX(")-1;\n\t\tend = &file[strlen(file)-1];\n\t\tif (*end == \')\')\n\t\t\t*end = \'\\0\';\n\t\tif ((end = strrchr(file, \'/\')) != NULL)\n\t\t\tfile = &end[1];\n\t}\n#endif\n\tes=ERR_get_state();\n\tes->top=(es->top+1)%ERR_NUM_ERRORS;\n\tif (es->top == es->bottom)\n\t\tes->bottom=(es->bottom+1)%ERR_NUM_ERRORS;\n\tes->err_flags[es->top]=0;\n\tes->err_buffer[es->top]=ERR_PACK(lib,func,reason);\n\tes->err_file[es->top]=file;\n\tes->err_line[es->top]=line;\n\terr_clear_data(es,es->top);\n\t}', 'void CRYPTO_free(void *str)\n\t{\n\tif (free_debug_func != NULL)\n\t\tfree_debug_func(str, 0);\n#ifdef LEVITTE_DEBUG_MEM\n\tfprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\\n", str);\n#endif\n\tfree_func(str);\n\tif (free_debug_func != NULL)\n\t\tfree_debug_func(NULL, 1);\n\t}', 'const char *OBJ_nid2sn(int n)\n\t{\n\tADDED_OBJ ad,*adp;\n\tASN1_OBJECT ob;\n\tif ((n >= 0) && (n < NUM_NID))\n\t\t{\n\t\tif ((n != NID_undef) && (nid_objs[n].nid == NID_undef))\n\t\t\t{\n\t\t\tOBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);\n\t\t\treturn(NULL);\n\t\t\t}\n\t\treturn(nid_objs[n].sn);\n\t\t}\n\telse if (added == NULL)\n\t\treturn(NULL);\n\telse\n\t\t{\n\t\tad.type=ADDED_NID;\n\t\tad.obj= &ob;\n\t\tob.nid=n;\n\t\tadp=(ADDED_OBJ *)lh_retrieve(added,&ad);\n\t\tif (adp != NULL)\n\t\t\treturn(adp->obj->sn);\n\t\telse\n\t\t\t{\n\t\t\tOBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);\n\t\t\treturn(NULL);\n\t\t\t}\n\t\t}\n\t}']