crypto/objects/obj_dat.c:489: error: NULL_DEREFERENCE
  pointer `s` last assigned on line 488 could be null and is dereferenced by call to `strncpy()` at line 489, column 3.
Showing all 71 steps of the trace


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

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

crypto/objects/obj_dat.c:438:6: Taking false branch
436.   	char tbuf[32];
437.   
438.   	if (buf_len <= 0) return(0);
            ^
439.   
440.   	if ((a == NULL) || (a->data == NULL)) {

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

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

crypto/objects/obj_dat.c:445:2: 
443.   	}
444.   
445. > 	nid=OBJ_obj2nid(a);
446.   	if ((nid == NID_undef) || no_name) {
447.   		len=a->length;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

crypto/err/err.c:360:1: start of procedure ERR_put_error()
    358.   /********************************************************/
    359.   
    360. > void ERR_put_error(int lib, int func, int reason, const char *file,
    361.   	     int line)
    362.   	{

crypto/err/err.c:384:2: Skipping ERR_get_state(): empty list of specs
    382.   	}
    383.   #endif
    384.   	es=ERR_get_state();
            ^
    385.   
    386.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:386:2: 
    384.   	es=ERR_get_state();
    385.   
    386. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    387.   	if (es->top == es->bottom)
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:387:6: Taking false branch
    385.   
    386.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    387.   	if (es->top == es->bottom)
                ^
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:389:2: 
    387.   	if (es->top == es->bottom)
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    389. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    390.   	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;

crypto/err/err.c:390:2: 
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    390. > 	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);

crypto/err/err.c:391:2: 
    389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    390.   	es->err_file[es->top]=file;
    391. > 	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
    393.   	}

crypto/err/err.c:392:2: Taking true branch
    390.   	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
            ^
    393.   	}
    394.   

crypto/err/err.c:392:2: Taking true branch
    390.   	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
            ^
    393.   	}
    394.   

crypto/mem.c:241:1: start of procedure CRYPTO_free()
      239.   	}
      240.   
      241. > void CRYPTO_free(void *str)
      242.   	{
      243.   	if (free_debug_func != NULL)

crypto/mem.c:243:6: Taking true branch
      241.   void CRYPTO_free(void *str)
      242.   	{
      243.   	if (free_debug_func != NULL)
                  ^
      244.   		free_debug_func(str, 0);
      245.   #ifdef LEVITTE_DEBUG_MEM

crypto/mem.c:244:3: Skipping __function_pointer__(): unresolved function pointer
      242.   	{
      243.   	if (free_debug_func != NULL)
      244.   		free_debug_func(str, 0);
               ^
      245.   #ifdef LEVITTE_DEBUG_MEM
      246.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);

crypto/mem.c:248:2: Skipping __function_pointer__(): unresolved function pointer
      246.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);
      247.   #endif
      248.   	free_func(str);
              ^
      249.   	if (free_debug_func != NULL)
      250.   		free_debug_func(NULL, 1);

crypto/mem.c:249:6: Taking true branch
      247.   #endif
      248.   	free_func(str);
      249.   	if (free_debug_func != NULL)
                  ^
      250.   		free_debug_func(NULL, 1);
      251.   	}

crypto/mem.c:250:3: Skipping __function_pointer__(): unresolved function pointer
      248.   	free_func(str);
      249.   	if (free_debug_func != NULL)
      250.   		free_debug_func(NULL, 1);
               ^
      251.   	}
      252.   

crypto/mem.c:249:2: 
      247.   #endif
      248.   	free_func(str);
      249. > 	if (free_debug_func != NULL)
      250.   		free_debug_func(NULL, 1);
      251.   	}

crypto/mem.c:251:2: return from a call to CRYPTO_free
      249.   	if (free_debug_func != NULL)
      250.   		free_debug_func(NULL, 1);
      251.   	}
              ^
      252.   
      253.   void *CRYPTO_remalloc(void *a, int num, const char *file, int line)

crypto/err/err.c:392:2: 
    390.   	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;
    392. > 	err_clear_data(es,es->top);
    393.   	}
    394.   

crypto/err/err.c:393:2: return from a call to ERR_put_error
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
    393.   	}
            ^
    394.   
    395.   void ERR_clear_error(void)

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

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

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

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

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

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

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

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

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

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

crypto/err/err.c:360:1: start of procedure ERR_put_error()
    358.   /********************************************************/
    359.   
    360. > void ERR_put_error(int lib, int func, int reason, const char *file,
    361.   	     int line)
    362.   	{

crypto/err/err.c:384:2: Skipping ERR_get_state(): empty list of specs
    382.   	}
    383.   #endif
    384.   	es=ERR_get_state();
            ^
    385.   
    386.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:386:2: 
    384.   	es=ERR_get_state();
    385.   
    386. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    387.   	if (es->top == es->bottom)
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:387:6: Taking false branch
    385.   
    386.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    387.   	if (es->top == es->bottom)
                ^
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:389:2: 
    387.   	if (es->top == es->bottom)
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    389. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    390.   	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;

crypto/err/err.c:390:2: 
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    390. > 	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);

crypto/err/err.c:391:2: 
    389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    390.   	es->err_file[es->top]=file;
    391. > 	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
    393.   	}

crypto/err/err.c:392:2: Taking true branch
    390.   	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
            ^
    393.   	}
    394.   

crypto/err/err.c:392:2: Taking true branch
    390.   	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
            ^
    393.   	}
    394.   

crypto/mem.c:241:1: start of procedure CRYPTO_free()
      239.   	}
      240.   
      241. > void CRYPTO_free(void *str)
      242.   	{
      243.   	if (free_debug_func != NULL)

crypto/mem.c:243:6: Taking true branch
      241.   void CRYPTO_free(void *str)
      242.   	{
      243.   	if (free_debug_func != NULL)
                  ^
      244.   		free_debug_func(str, 0);
      245.   #ifdef LEVITTE_DEBUG_MEM

crypto/mem.c:244:3: Skipping __function_pointer__(): unresolved function pointer
      242.   	{
      243.   	if (free_debug_func != NULL)
      244.   		free_debug_func(str, 0);
               ^
      245.   #ifdef LEVITTE_DEBUG_MEM
      246.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);

crypto/mem.c:248:2: Skipping __function_pointer__(): unresolved function pointer
      246.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);
      247.   #endif
      248.   	free_func(str);
              ^
      249.   	if (free_debug_func != NULL)
      250.   		free_debug_func(NULL, 1);

crypto/mem.c:249:6: Taking true branch
      247.   #endif
      248.   	free_func(str);
      249.   	if (free_debug_func != NULL)
                  ^
      250.   		free_debug_func(NULL, 1);
      251.   	}

crypto/mem.c:250:3: Skipping __function_pointer__(): unresolved function pointer
      248.   	free_func(str);
      249.   	if (free_debug_func != NULL)
      250.   		free_debug_func(NULL, 1);
               ^
      251.   	}
      252.   

crypto/mem.c:249:2: 
      247.   #endif
      248.   	free_func(str);
      249. > 	if (free_debug_func != NULL)
      250.   		free_debug_func(NULL, 1);
      251.   	}

crypto/mem.c:251:2: return from a call to CRYPTO_free
      249.   	if (free_debug_func != NULL)
      250.   		free_debug_func(NULL, 1);
      251.   	}
              ^
      252.   
      253.   void *CRYPTO_remalloc(void *a, int num, const char *file, int line)

crypto/err/err.c:392:2: 
    390.   	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;
    392. > 	err_clear_data(es,es->top);
    393.   	}
    394.   

crypto/err/err.c:393:2: return from a call to ERR_put_error
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
    393.   	}
            ^
    394.   
    395.   void ERR_clear_error(void)

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

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

crypto/objects/obj_dat.c:489:3: 
487.   		if (s == NULL)
488.   			s=OBJ_nid2sn(nid);
489. > 		strncpy(buf,s,buf_len);
490.   		n=strlen(s);
491.   	}

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[32];
	if (buf_len <= 0) return(0);
	if ((a == NULL) || (a->data == NULL)) {
		buf[0]='\0';
		return(0);
	}
	nid=OBJ_obj2nid(a);
	if ((nid == NID_undef) || no_name) {
		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);
		strncpy(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)
					strncpy(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);
		strncpy(buf,s,buf_len);
		n=strlen(s);
	}
	buf[buf_len-1]='\0';
	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[32];\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\tnid=OBJ_obj2nid(a);\n\tif ((nid == NID_undef) || no_name) {\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\tstrncpy(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\tstrncpy(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\tstrncpy(buf,s,buf_len);\n\t\tn=strlen(s);\n\t}\n\tbuf[buf_len-1]=\'\\0\';\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_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}']