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


crypto/objects/obj_dat.c:417:1: start of procedure OBJ_obj2txt()
415.   	}
416.   
417. > int OBJ_obj2txt(char *buf, int buf_len, ASN1_OBJECT *a, int no_name)
418.   {
419.   	int i,idx=0,n=0,len,nid;

crypto/objects/obj_dat.c:419:2: 
417.   int OBJ_obj2txt(char *buf, int buf_len, ASN1_OBJECT *a, int no_name)
418.   {
419. > 	int i,idx=0,n=0,len,nid;
420.   	unsigned long l;
421.   	unsigned char *p;

crypto/objects/obj_dat.c:425:6: Taking false branch
423.   	char tbuf[32];
424.   
425.   	if (buf_len <= 0) return(0);
            ^
426.   
427.   	if ((a == NULL) || (a->data == NULL)) {

crypto/objects/obj_dat.c:427:7: Taking false branch
425.   	if (buf_len <= 0) return(0);
426.   
427.   	if ((a == NULL) || (a->data == NULL)) {
             ^
428.   		buf[0]='\0';
429.   		return(0);

crypto/objects/obj_dat.c:427:22: Taking false branch
425.   	if (buf_len <= 0) return(0);
426.   
427.   	if ((a == NULL) || (a->data == NULL)) {
                            ^
428.   		buf[0]='\0';
429.   		return(0);

crypto/objects/obj_dat.c:432:2: 
430.   	}
431.   
432. > 	nid=OBJ_obj2nid(a);
433.   	if ((nid == NID_undef) || no_name) {
434.   		len=a->length;

crypto/objects/obj_dat.c:350:1: start of procedure OBJ_obj2nid()
  348.   	}
  349.   
  350. > int OBJ_obj2nid(ASN1_OBJECT *a)
  351.   	{
  352.   	ASN1_OBJECT **op;

crypto/objects/obj_dat.c:355:6: Taking false branch
  353.   	ADDED_OBJ ad,*adp;
  354.   
  355.   	if (a == NULL)
              ^
  356.   		return(NID_undef);
  357.   	if (a->nid != 0)

crypto/objects/obj_dat.c:357:6: Taking true branch
  355.   	if (a == NULL)
  356.   		return(NID_undef);
  357.   	if (a->nid != 0)
              ^
  358.   		return(a->nid);
  359.   

crypto/objects/obj_dat.c:358:3: 
  356.   		return(NID_undef);
  357.   	if (a->nid != 0)
  358. > 		return(a->nid);
  359.   
  360.   	if (added != NULL)

crypto/objects/obj_dat.c:372:2: return from a call to OBJ_obj2nid
  370.   		return(NID_undef);
  371.   	return((*op)->nid);
  372.   	}
          ^
  373.   
  374.   /* Convert an object name into an ASN1_OBJECT

crypto/objects/obj_dat.c:433:7: Taking false branch
431.   
432.   	nid=OBJ_obj2nid(a);
433.   	if ((nid == NID_undef) || no_name) {
             ^
434.   		len=a->length;
435.   		p=a->data;

crypto/objects/obj_dat.c:433:28: Taking false branch
431.   
432.   	nid=OBJ_obj2nid(a);
433.   	if ((nid == NID_undef) || no_name) {
                                  ^
434.   		len=a->length;
435.   		p=a->data;

crypto/objects/obj_dat.c:473:3: 
471.   		}
472.   	} else {
473. > 		s=OBJ_nid2ln(nid);
474.   		if (s == NULL)
475.   			s=OBJ_nid2sn(nid);

crypto/objects/obj_dat.c:318:1: start of procedure OBJ_nid2ln()
  316.   	}
  317.   
  318. > const char *OBJ_nid2ln(int n)
  319.   	{
  320.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:323:7: Taking true branch
  321.   	ASN1_OBJECT ob;
  322.   
  323.   	if ((n >= 0) && (n < NUM_NID))
               ^
  324.   		{
  325.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:323:19: Taking true branch
  321.   	ASN1_OBJECT ob;
  322.   
  323.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  324.   		{
  325.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:325:8: Taking true branch
  323.   	if ((n >= 0) && (n < NUM_NID))
  324.   		{
  325.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                ^
  326.   			{
  327.   			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:325:28: Taking true branch
  323.   	if ((n >= 0) && (n < NUM_NID))
  324.   		{
  325.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                    ^
  326.   			{
  327.   			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:327:4: 
  325.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
  326.   			{
  327. > 			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);
  328.   			return(NULL);
  329.   			}

crypto/err/err.c:245:1: start of procedure ERR_put_error()
    243.   /********************************************************/
    244.   
    245. > void ERR_put_error(int lib, int func, int reason, const char *file,
    246.   	     int line)
    247.   	{

crypto/err/err.c:269:2: Skipping ERR_get_state(): empty list of specs
    267.   	}
    268.   #endif
    269.   	es=ERR_get_state();
            ^
    270.   
    271.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:271:2: 
    269.   	es=ERR_get_state();
    270.   
    271. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    272.   	if (es->top == es->bottom)
    273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:272:6: Taking false branch
    270.   
    271.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    272.   	if (es->top == es->bottom)
                ^
    273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    274.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:274:2: 
    272.   	if (es->top == es->bottom)
    273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    274. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    275.   	es->err_file[es->top]=file;
    276.   	es->err_line[es->top]=line;

crypto/err/err.c:275:2: 
    273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    274.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    275. > 	es->err_file[es->top]=file;
    276.   	es->err_line[es->top]=line;
    277.   	err_clear_data(es,es->top);

crypto/err/err.c:276:2: 
    274.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    275.   	es->err_file[es->top]=file;
    276. > 	es->err_line[es->top]=line;
    277.   	err_clear_data(es,es->top);
    278.   	}

crypto/err/err.c:277:2: Taking true branch
    275.   	es->err_file[es->top]=file;
    276.   	es->err_line[es->top]=line;
    277.   	err_clear_data(es,es->top);
            ^
    278.   	}
    279.   

crypto/err/err.c:277:2: Taking true branch
    275.   	es->err_file[es->top]=file;
    276.   	es->err_line[es->top]=line;
    277.   	err_clear_data(es,es->top);
            ^
    278.   	}
    279.   

crypto/mem.c:230:1: start of procedure CRYPTO_free()
      228.   	}
      229.   
      230. > void CRYPTO_free(void *str)
      231.   	{
      232.   	if (free_debug_func != NULL)

crypto/mem.c:232:6: Taking true branch
      230.   void CRYPTO_free(void *str)
      231.   	{
      232.   	if (free_debug_func != NULL)
                  ^
      233.   		free_debug_func(str, 0);
      234.   #ifdef LEVITTE_DEBUG

crypto/mem.c:233:3: Skipping __function_pointer__(): unresolved function pointer
      231.   	{
      232.   	if (free_debug_func != NULL)
      233.   		free_debug_func(str, 0);
               ^
      234.   #ifdef LEVITTE_DEBUG
      235.   	fprintf(stderr, "LEVITTE_DEBUG:         < 0x%p\n", str);

crypto/mem.c:237:2: Skipping __function_pointer__(): unresolved function pointer
      235.   	fprintf(stderr, "LEVITTE_DEBUG:         < 0x%p\n", str);
      236.   #endif
      237.   	free_func(str);
              ^
      238.   	if (free_debug_func != NULL)
      239.   		free_debug_func(NULL, 1);

crypto/mem.c:238:6: Taking true branch
      236.   #endif
      237.   	free_func(str);
      238.   	if (free_debug_func != NULL)
                  ^
      239.   		free_debug_func(NULL, 1);
      240.   	}

crypto/mem.c:239:3: Skipping __function_pointer__(): unresolved function pointer
      237.   	free_func(str);
      238.   	if (free_debug_func != NULL)
      239.   		free_debug_func(NULL, 1);
               ^
      240.   	}
      241.   

crypto/mem.c:238:2: 
      236.   #endif
      237.   	free_func(str);
      238. > 	if (free_debug_func != NULL)
      239.   		free_debug_func(NULL, 1);
      240.   	}

crypto/mem.c:240:2: return from a call to CRYPTO_free
      238.   	if (free_debug_func != NULL)
      239.   		free_debug_func(NULL, 1);
      240.   	}
              ^
      241.   
      242.   void *CRYPTO_remalloc(void *a, int num, char *file, int line)

crypto/err/err.c:277:2: 
    275.   	es->err_file[es->top]=file;
    276.   	es->err_line[es->top]=line;
    277. > 	err_clear_data(es,es->top);
    278.   	}
    279.   

crypto/err/err.c:278:2: return from a call to ERR_put_error
    276.   	es->err_line[es->top]=line;
    277.   	err_clear_data(es,es->top);
    278.   	}
            ^
    279.   
    280.   void ERR_clear_error(void)

crypto/objects/obj_dat.c:328:4: 
  326.   			{
  327.   			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);
  328. > 			return(NULL);
  329.   			}
  330.   		return(nid_objs[n].ln);

crypto/objects/obj_dat.c:348:2: return from a call to OBJ_nid2ln
  346.   			}
  347.   		}
  348.   	}
          ^
  349.   
  350.   int OBJ_obj2nid(ASN1_OBJECT *a)

crypto/objects/obj_dat.c:474:7: Taking true branch
472.   	} else {
473.   		s=OBJ_nid2ln(nid);
474.   		if (s == NULL)
             ^
475.   			s=OBJ_nid2sn(nid);
476.   		strncpy(buf,s,buf_len);

crypto/objects/obj_dat.c:475:4: 
473.   		s=OBJ_nid2ln(nid);
474.   		if (s == NULL)
475. > 			s=OBJ_nid2sn(nid);
476.   		strncpy(buf,s,buf_len);
477.   		n=strlen(s);

crypto/objects/obj_dat.c:286:1: start of procedure OBJ_nid2sn()
  284.   	}
  285.   
  286. > const char *OBJ_nid2sn(int n)
  287.   	{
  288.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:291:7: Taking true branch
  289.   	ASN1_OBJECT ob;
  290.   
  291.   	if ((n >= 0) && (n < NUM_NID))
               ^
  292.   		{
  293.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:291:19: Taking true branch
  289.   	ASN1_OBJECT ob;
  290.   
  291.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  292.   		{
  293.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:293:8: Taking true branch
  291.   	if ((n >= 0) && (n < NUM_NID))
  292.   		{
  293.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                ^
  294.   			{
  295.   			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:293:28: Taking true branch
  291.   	if ((n >= 0) && (n < NUM_NID))
  292.   		{
  293.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                    ^
  294.   			{
  295.   			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:295:4: 
  293.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
  294.   			{
  295. > 			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);
  296.   			return(NULL);
  297.   			}

crypto/err/err.c:245:1: start of procedure ERR_put_error()
    243.   /********************************************************/
    244.   
    245. > void ERR_put_error(int lib, int func, int reason, const char *file,
    246.   	     int line)
    247.   	{

crypto/err/err.c:269:2: Skipping ERR_get_state(): empty list of specs
    267.   	}
    268.   #endif
    269.   	es=ERR_get_state();
            ^
    270.   
    271.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:271:2: 
    269.   	es=ERR_get_state();
    270.   
    271. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    272.   	if (es->top == es->bottom)
    273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:272:6: Taking false branch
    270.   
    271.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    272.   	if (es->top == es->bottom)
                ^
    273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    274.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:274:2: 
    272.   	if (es->top == es->bottom)
    273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    274. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    275.   	es->err_file[es->top]=file;
    276.   	es->err_line[es->top]=line;

crypto/err/err.c:275:2: 
    273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    274.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    275. > 	es->err_file[es->top]=file;
    276.   	es->err_line[es->top]=line;
    277.   	err_clear_data(es,es->top);

crypto/err/err.c:276:2: 
    274.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    275.   	es->err_file[es->top]=file;
    276. > 	es->err_line[es->top]=line;
    277.   	err_clear_data(es,es->top);
    278.   	}

crypto/err/err.c:277:2: Taking true branch
    275.   	es->err_file[es->top]=file;
    276.   	es->err_line[es->top]=line;
    277.   	err_clear_data(es,es->top);
            ^
    278.   	}
    279.   

crypto/err/err.c:277:2: Taking true branch
    275.   	es->err_file[es->top]=file;
    276.   	es->err_line[es->top]=line;
    277.   	err_clear_data(es,es->top);
            ^
    278.   	}
    279.   

crypto/mem.c:230:1: start of procedure CRYPTO_free()
      228.   	}
      229.   
      230. > void CRYPTO_free(void *str)
      231.   	{
      232.   	if (free_debug_func != NULL)

crypto/mem.c:232:6: Taking true branch
      230.   void CRYPTO_free(void *str)
      231.   	{
      232.   	if (free_debug_func != NULL)
                  ^
      233.   		free_debug_func(str, 0);
      234.   #ifdef LEVITTE_DEBUG

crypto/mem.c:233:3: Skipping __function_pointer__(): unresolved function pointer
      231.   	{
      232.   	if (free_debug_func != NULL)
      233.   		free_debug_func(str, 0);
               ^
      234.   #ifdef LEVITTE_DEBUG
      235.   	fprintf(stderr, "LEVITTE_DEBUG:         < 0x%p\n", str);

crypto/mem.c:237:2: Skipping __function_pointer__(): unresolved function pointer
      235.   	fprintf(stderr, "LEVITTE_DEBUG:         < 0x%p\n", str);
      236.   #endif
      237.   	free_func(str);
              ^
      238.   	if (free_debug_func != NULL)
      239.   		free_debug_func(NULL, 1);

crypto/mem.c:238:6: Taking true branch
      236.   #endif
      237.   	free_func(str);
      238.   	if (free_debug_func != NULL)
                  ^
      239.   		free_debug_func(NULL, 1);
      240.   	}

crypto/mem.c:239:3: Skipping __function_pointer__(): unresolved function pointer
      237.   	free_func(str);
      238.   	if (free_debug_func != NULL)
      239.   		free_debug_func(NULL, 1);
               ^
      240.   	}
      241.   

crypto/mem.c:238:2: 
      236.   #endif
      237.   	free_func(str);
      238. > 	if (free_debug_func != NULL)
      239.   		free_debug_func(NULL, 1);
      240.   	}

crypto/mem.c:240:2: return from a call to CRYPTO_free
      238.   	if (free_debug_func != NULL)
      239.   		free_debug_func(NULL, 1);
      240.   	}
              ^
      241.   
      242.   void *CRYPTO_remalloc(void *a, int num, char *file, int line)

crypto/err/err.c:277:2: 
    275.   	es->err_file[es->top]=file;
    276.   	es->err_line[es->top]=line;
    277. > 	err_clear_data(es,es->top);
    278.   	}
    279.   

crypto/err/err.c:278:2: return from a call to ERR_put_error
    276.   	es->err_line[es->top]=line;
    277.   	err_clear_data(es,es->top);
    278.   	}
            ^
    279.   
    280.   void ERR_clear_error(void)

crypto/objects/obj_dat.c:296:4: 
  294.   			{
  295.   			OBJerr(OBJ_F_OBJ_NID2SN,OBJ_R_UNKNOWN_NID);
  296. > 			return(NULL);
  297.   			}
  298.   		return(nid_objs[n].sn);

crypto/objects/obj_dat.c:316:2: return from a call to OBJ_nid2sn
  314.   			}
  315.   		}
  316.   	}
          ^
  317.   
  318.   const char *OBJ_nid2ln(int n)

crypto/objects/obj_dat.c:476:3: 
474.   		if (s == NULL)
475.   			s=OBJ_nid2sn(nid);
476. > 		strncpy(buf,s,buf_len);
477.   		n=strlen(s);
478.   	}

int OBJ_obj2txt(char *buf, int buf_len, 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, 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(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=a;\n\t\tadp=(ADDED_OBJ *)lh_retrieve(added,(char *)&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 *),(int (*)())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,(char *)&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\n\tfprintf(stderr, "LEVITTE_DEBUG:         < 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,(char *)&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}']