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


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

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

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

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

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

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

crypto/objects/obj_dat.c:448:17: 
446.   	}
447.   
448. > 	if (no_name || (nid=OBJ_obj2nid(a)) == NID_undef) {
449.   		len=a->length;
450.   		p=a->data;

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

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

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

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

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

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

crypto/objects/obj_dat.c:488:3: 
486.   		}
487.   	} else {
488. > 		s=OBJ_nid2ln(nid);
489.   		if (s == NULL)
490.   			s=OBJ_nid2sn(nid);

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

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

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

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

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

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

crypto/err/err.c:630:1: start of procedure ERR_put_error()
    628.   /********************************************************/
    629.   
    630. > void ERR_put_error(int lib, int func, int reason, const char *file,
    631.   	     int line)
    632.   	{

crypto/err/err.c:654:2: Skipping ERR_get_state(): empty list of specs
    652.   	}
    653.   #endif
    654.   	es=ERR_get_state();
            ^
    655.   
    656.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:656:2: 
    654.   	es=ERR_get_state();
    655.   
    656. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    657.   	if (es->top == es->bottom)
    658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:657:6: Taking false branch
    655.   
    656.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    657.   	if (es->top == es->bottom)
                ^
    658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    659.   	es->err_flags[es->top]=0;

crypto/err/err.c:659:2: 
    657.   	if (es->top == es->bottom)
    658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    659. > 	es->err_flags[es->top]=0;
    660.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    661.   	es->err_file[es->top]=file;

crypto/err/err.c:660:2: 
    658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    659.   	es->err_flags[es->top]=0;
    660. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    661.   	es->err_file[es->top]=file;
    662.   	es->err_line[es->top]=line;

crypto/err/err.c:661:2: 
    659.   	es->err_flags[es->top]=0;
    660.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    661. > 	es->err_file[es->top]=file;
    662.   	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);

crypto/err/err.c:662:2: 
    660.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    661.   	es->err_file[es->top]=file;
    662. > 	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);
    664.   	}

crypto/err/err.c:663:2: Taking true branch
    661.   	es->err_file[es->top]=file;
    662.   	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);
            ^
    664.   	}
    665.   

crypto/err/err.c:663:2: Taking true branch
    661.   	es->err_file[es->top]=file;
    662.   	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);
            ^
    664.   	}
    665.   

crypto/mem.c:367:1: start of procedure CRYPTO_free()
      365.   	}
      366.   
      367. > void CRYPTO_free(void *str)
      368.   	{
      369.   	if (free_debug_func != NULL)

crypto/mem.c:369:6: Taking true branch
      367.   void CRYPTO_free(void *str)
      368.   	{
      369.   	if (free_debug_func != NULL)
                  ^
      370.   		free_debug_func(str, 0);
      371.   #ifdef LEVITTE_DEBUG_MEM

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

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

crypto/mem.c:375:6: Taking true branch
      373.   #endif
      374.   	free_func(str);
      375.   	if (free_debug_func != NULL)
                  ^
      376.   		free_debug_func(NULL, 1);
      377.   	}

crypto/mem.c:376:3: Skipping __function_pointer__(): unresolved function pointer
      374.   	free_func(str);
      375.   	if (free_debug_func != NULL)
      376.   		free_debug_func(NULL, 1);
               ^
      377.   	}
      378.   

crypto/mem.c:375:2: 
      373.   #endif
      374.   	free_func(str);
      375. > 	if (free_debug_func != NULL)
      376.   		free_debug_func(NULL, 1);
      377.   	}

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

crypto/err/err.c:663:2: Loop condition is false. Leaving loop
    661.   	es->err_file[es->top]=file;
    662.   	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);
            ^
    664.   	}
    665.   

crypto/err/err.c:664:2: return from a call to ERR_put_error
    662.   	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);
    664.   	}
            ^
    665.   
    666.   void ERR_clear_error(void)

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

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

crypto/objects/obj_dat.c:489:7: Taking true branch
487.   	} else {
488.   		s=OBJ_nid2ln(nid);
489.   		if (s == NULL)
             ^
490.   			s=OBJ_nid2sn(nid);
491.   		BUF_strlcpy(buf,s,buf_len);

crypto/objects/obj_dat.c:490:4: 
488.   		s=OBJ_nid2ln(nid);
489.   		if (s == NULL)
490. > 			s=OBJ_nid2sn(nid);
491.   		BUF_strlcpy(buf,s,buf_len);
492.   		n=strlen(s);

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

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

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

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

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

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

crypto/err/err.c:630:1: start of procedure ERR_put_error()
    628.   /********************************************************/
    629.   
    630. > void ERR_put_error(int lib, int func, int reason, const char *file,
    631.   	     int line)
    632.   	{

crypto/err/err.c:654:2: Skipping ERR_get_state(): empty list of specs
    652.   	}
    653.   #endif
    654.   	es=ERR_get_state();
            ^
    655.   
    656.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:656:2: 
    654.   	es=ERR_get_state();
    655.   
    656. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    657.   	if (es->top == es->bottom)
    658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:657:6: Taking false branch
    655.   
    656.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    657.   	if (es->top == es->bottom)
                ^
    658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    659.   	es->err_flags[es->top]=0;

crypto/err/err.c:659:2: 
    657.   	if (es->top == es->bottom)
    658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    659. > 	es->err_flags[es->top]=0;
    660.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    661.   	es->err_file[es->top]=file;

crypto/err/err.c:660:2: 
    658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    659.   	es->err_flags[es->top]=0;
    660. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    661.   	es->err_file[es->top]=file;
    662.   	es->err_line[es->top]=line;

crypto/err/err.c:661:2: 
    659.   	es->err_flags[es->top]=0;
    660.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    661. > 	es->err_file[es->top]=file;
    662.   	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);

crypto/err/err.c:662:2: 
    660.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    661.   	es->err_file[es->top]=file;
    662. > 	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);
    664.   	}

crypto/err/err.c:663:2: Taking true branch
    661.   	es->err_file[es->top]=file;
    662.   	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);
            ^
    664.   	}
    665.   

crypto/err/err.c:663:2: Taking true branch
    661.   	es->err_file[es->top]=file;
    662.   	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);
            ^
    664.   	}
    665.   

crypto/mem.c:367:1: start of procedure CRYPTO_free()
      365.   	}
      366.   
      367. > void CRYPTO_free(void *str)
      368.   	{
      369.   	if (free_debug_func != NULL)

crypto/mem.c:369:6: Taking true branch
      367.   void CRYPTO_free(void *str)
      368.   	{
      369.   	if (free_debug_func != NULL)
                  ^
      370.   		free_debug_func(str, 0);
      371.   #ifdef LEVITTE_DEBUG_MEM

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

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

crypto/mem.c:375:6: Taking true branch
      373.   #endif
      374.   	free_func(str);
      375.   	if (free_debug_func != NULL)
                  ^
      376.   		free_debug_func(NULL, 1);
      377.   	}

crypto/mem.c:376:3: Skipping __function_pointer__(): unresolved function pointer
      374.   	free_func(str);
      375.   	if (free_debug_func != NULL)
      376.   		free_debug_func(NULL, 1);
               ^
      377.   	}
      378.   

crypto/mem.c:375:2: 
      373.   #endif
      374.   	free_func(str);
      375. > 	if (free_debug_func != NULL)
      376.   		free_debug_func(NULL, 1);
      377.   	}

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

crypto/err/err.c:663:2: Loop condition is false. Leaving loop
    661.   	es->err_file[es->top]=file;
    662.   	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);
            ^
    664.   	}
    665.   

crypto/err/err.c:664:2: return from a call to ERR_put_error
    662.   	es->err_line[es->top]=line;
    663.   	err_clear_data(es,es->top);
    664.   	}
            ^
    665.   
    666.   void ERR_clear_error(void)

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

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

crypto/objects/obj_dat.c:491:3: Skipping BUF_strlcpy(): empty list of specs
489.   		if (s == NULL)
490.   			s=OBJ_nid2sn(nid);
491.   		BUF_strlcpy(buf,s,buf_len);
         ^
492.   		n=strlen(s);
493.   	}

crypto/objects/obj_dat.c:492:3: 
490.   			s=OBJ_nid2sn(nid);
491.   		BUF_strlcpy(buf,s,buf_len);
492. > 		n=strlen(s);
493.   	}
494.   	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);
		sprintf(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)) {
				sprintf(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\tsprintf(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\tsprintf(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}']