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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
{
	int i,n=0,len,nid, first, use_bn;
	BIGNUM *bl;
	unsigned long l;
	const unsigned char *p;
	char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];
	if ((a == NULL) || (a->data == NULL)) {
		buf[0]='\0';
		return(0);
	}
	if (!no_name && (nid=OBJ_obj2nid(a)) != NID_undef)
		{
		const char *s;
		s=OBJ_nid2ln(nid);
		if (s == NULL)
			s=OBJ_nid2sn(nid);
		if (buf)
			BUF_strlcpy(buf,s,buf_len);
		n=strlen(s);
		return n;
		}
	len=a->length;
	p=a->data;
	first = 1;
	bl = NULL;
	while (len > 0)
		{
		l=0;
		use_bn = 0;
		for (;;)
			{
			unsigned char c = *p++;
			len--;
			if ((len == 0) && (c & 0x80))
				goto err;
			if (use_bn)
				{
				if (!BN_add_word(bl, c & 0x7f))
					goto err;
				}
			else
				l |= c  & 0x7f;
			if (!(c & 0x80))
				break;
			if (!use_bn && (l > (ULONG_MAX >> 7L)))
				{
				if (!bl && !(bl = BN_new()))
					goto err;
				if (!BN_set_word(bl, l))
					goto err;
				use_bn = 1;
				}
			if (use_bn)
				{
				if (!BN_lshift(bl, bl, 7))
					goto err;
				}
			else
				l<<=7L;
			}
		if (first)
			{
			first = 0;
			if (l >= 80)
				{
				i = 2;
				if (use_bn)
					{
					if (!BN_sub_word(bl, 80))
						goto err;
					}
				else
					l -= 80;
				}
			else
				{
				i=(int)(l/40);
				l-=(long)(i*40);
				}
			if (buf && (buf_len > 0))
				{
				*buf++ = i + '0';
				buf_len--;
				}
			n++;
			}
		if (use_bn)
			{
			char *bndec;
			bndec = BN_bn2dec(bl);
			if (!bndec)
				goto err;
			i = strlen(bndec);
			if (buf)
				{
				if (buf_len > 0)
					{
					*buf++ = '.';
					buf_len--;
					}
				BUF_strlcpy(buf,bndec,buf_len);
				if (i > buf_len)
					{
					buf += buf_len;
					buf_len = 0;
					}
				else
					{
					buf+=i;
					buf_len-=i;
					}
				}
			n++;
			n += i;
			OPENSSL_free(bndec);
			}
		else
			{
			BIO_snprintf(tbuf,sizeof tbuf,".%lu",l);
			i=strlen(tbuf);
			if (buf && (buf_len > 0))
				{
				BUF_strlcpy(buf,tbuf,buf_len);
				if (i > buf_len)
					{
					buf += buf_len;
					buf_len = 0;
					}
				else
					{
					buf+=i;
					buf_len-=i;
					}
				}
			n+=i;
			l=0;
			}
		}
	if (bl)
		BN_free(bl);
	return n;
	err:
	if (bl)
		BN_free(bl);
	return -1;
}
['int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)\n{\n\tint i,n=0,len,nid, first, use_bn;\n\tBIGNUM *bl;\n\tunsigned long l;\n\tconst unsigned char *p;\n\tchar tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];\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\t{\n\t\tconst char *s;\n\t\ts=OBJ_nid2ln(nid);\n\t\tif (s == NULL)\n\t\t\ts=OBJ_nid2sn(nid);\n\t\tif (buf)\n\t\t\tBUF_strlcpy(buf,s,buf_len);\n\t\tn=strlen(s);\n\t\treturn n;\n\t\t}\n\tlen=a->length;\n\tp=a->data;\n\tfirst = 1;\n\tbl = NULL;\n\twhile (len > 0)\n\t\t{\n\t\tl=0;\n\t\tuse_bn = 0;\n\t\tfor (;;)\n\t\t\t{\n\t\t\tunsigned char c = *p++;\n\t\t\tlen--;\n\t\t\tif ((len == 0) && (c & 0x80))\n\t\t\t\tgoto err;\n\t\t\tif (use_bn)\n\t\t\t\t{\n\t\t\t\tif (!BN_add_word(bl, c & 0x7f))\n\t\t\t\t\tgoto err;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tl |= c  & 0x7f;\n\t\t\tif (!(c & 0x80))\n\t\t\t\tbreak;\n\t\t\tif (!use_bn && (l > (ULONG_MAX >> 7L)))\n\t\t\t\t{\n\t\t\t\tif (!bl && !(bl = BN_new()))\n\t\t\t\t\tgoto err;\n\t\t\t\tif (!BN_set_word(bl, l))\n\t\t\t\t\tgoto err;\n\t\t\t\tuse_bn = 1;\n\t\t\t\t}\n\t\t\tif (use_bn)\n\t\t\t\t{\n\t\t\t\tif (!BN_lshift(bl, bl, 7))\n\t\t\t\t\tgoto err;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tl<<=7L;\n\t\t\t}\n\t\tif (first)\n\t\t\t{\n\t\t\tfirst = 0;\n\t\t\tif (l >= 80)\n\t\t\t\t{\n\t\t\t\ti = 2;\n\t\t\t\tif (use_bn)\n\t\t\t\t\t{\n\t\t\t\t\tif (!BN_sub_word(bl, 80))\n\t\t\t\t\t\tgoto err;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tl -= 80;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\ti=(int)(l/40);\n\t\t\t\tl-=(long)(i*40);\n\t\t\t\t}\n\t\t\tif (buf && (buf_len > 0))\n\t\t\t\t{\n\t\t\t\t*buf++ = i + \'0\';\n\t\t\t\tbuf_len--;\n\t\t\t\t}\n\t\t\tn++;\n\t\t\t}\n\t\tif (use_bn)\n\t\t\t{\n\t\t\tchar *bndec;\n\t\t\tbndec = BN_bn2dec(bl);\n\t\t\tif (!bndec)\n\t\t\t\tgoto err;\n\t\t\ti = strlen(bndec);\n\t\t\tif (buf)\n\t\t\t\t{\n\t\t\t\tif (buf_len > 0)\n\t\t\t\t\t{\n\t\t\t\t\t*buf++ = \'.\';\n\t\t\t\t\tbuf_len--;\n\t\t\t\t\t}\n\t\t\t\tBUF_strlcpy(buf,bndec,buf_len);\n\t\t\t\tif (i > buf_len)\n\t\t\t\t\t{\n\t\t\t\t\tbuf += buf_len;\n\t\t\t\t\tbuf_len = 0;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tbuf+=i;\n\t\t\t\t\tbuf_len-=i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tn++;\n\t\t\tn += i;\n\t\t\tOPENSSL_free(bndec);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tBIO_snprintf(tbuf,sizeof tbuf,".%lu",l);\n\t\t\ti=strlen(tbuf);\n\t\t\tif (buf && (buf_len > 0))\n\t\t\t\t{\n\t\t\t\tBUF_strlcpy(buf,tbuf,buf_len);\n\t\t\t\tif (i > buf_len)\n\t\t\t\t\t{\n\t\t\t\t\tbuf += buf_len;\n\t\t\t\t\tbuf_len = 0;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tbuf+=i;\n\t\t\t\t\tbuf_len-=i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tn+=i;\n\t\t\tl=0;\n\t\t\t}\n\t\t}\n\tif (bl)\n\t\tBN_free(bl);\n\treturn n;\n\terr:\n\tif (bl)\n\t\tBN_free(bl);\n\treturn -1;\n}', 'int OBJ_obj2nid(const ASN1_OBJECT *a)\n\t{\n\tconst unsigned int *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=(const unsigned int *)OBJ_bsearch((const char *)&a,(const char *)obj_objs,\n\t\tNUM_OBJ, sizeof(obj_objs[0]),obj_cmp);\n\tif (op == NULL)\n\t\treturn(NID_undef);\n\treturn(nid_objs[*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}']