crypto/asn1/t_x509.c:441: error: NULL_DEREFERENCE
  pointer `s` last assigned on line 440 could be null and is dereferenced at line 441, column 7.
Showing all 59 steps of the trace


crypto/asn1/t_x509.c:433:1: start of procedure X509_NAME_print()
431.   	}
432.   
433. > int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
434.   	{
435.   	char *s,*c,*b;

crypto/asn1/t_x509.c:436:2: 
434.   	{
435.   	char *s,*c,*b;
436. > 	int ret=0,l,i;
437.   
438.   	l=80-2-obase;

crypto/asn1/t_x509.c:438:2: 
436.   	int ret=0,l,i;
437.   
438. > 	l=80-2-obase;
439.   
440.   	b=s=X509_NAME_oneline(name,NULL,0);

crypto/asn1/t_x509.c:440:2: 
438.   	l=80-2-obase;
439.   
440. > 	b=s=X509_NAME_oneline(name,NULL,0);
441.   	if (!*s)
442.   		{

crypto/x509/x509_obj.c:66:1: start of procedure X509_NAME_oneline()
  64.   #include <openssl/buffer.h>
  65.   
  66. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
  67.   	{
  68.   	X509_NAME_ENTRY *ne;

crypto/x509/x509_obj.c:74:2: 
  72.   	char *p;
  73.   	unsigned char *q;
  74. > 	BUF_MEM *b=NULL;
  75.   	static char hex[17]="0123456789ABCDEF";
  76.   	int gs_doit[4];

crypto/x509/x509_obj.c:75:2: 
  73.   	unsigned char *q;
  74.   	BUF_MEM *b=NULL;
  75. > 	static char hex[17]="0123456789ABCDEF";
  76.   	int gs_doit[4];
  77.   	char tmp_buf[80];

crypto/x509/x509_obj.c:82:6: Taking true branch
  80.   #endif
  81.   
  82.   	if (buf == NULL)
             ^
  83.   		{
  84.   		if ((b=BUF_MEM_new()) == NULL) goto err;

crypto/x509/x509_obj.c:84:7: 
  82.   	if (buf == NULL)
  83.   		{
  84. > 		if ((b=BUF_MEM_new()) == NULL) goto err;
  85.   		if (!BUF_MEM_grow(b,200)) goto err;
  86.   		b->data[0]='\0';

crypto/buffer/buffer.c:63:1: start of procedure BUF_MEM_new()
    61.   #include <openssl/buffer.h>
    62.   
    63. > BUF_MEM *BUF_MEM_new(void)
    64.   	{
    65.   	BUF_MEM *ret;

crypto/buffer/buffer.c:67:2: 
    65.   	BUF_MEM *ret;
    66.   
    67. > 	ret=OPENSSL_malloc(sizeof(BUF_MEM));
    68.   	if (ret == NULL)
    69.   		{

crypto/mem.c:294:1: start of procedure CRYPTO_malloc()
      292.   	}
      293.   
      294. > void *CRYPTO_malloc(int num, const char *file, int line)
      295.   	{
      296.   	void *ret = NULL;

crypto/mem.c:296:2: 
      294.   void *CRYPTO_malloc(int num, const char *file, int line)
      295.   	{
      296. > 	void *ret = NULL;
      297.   
      298.   	if (num <= 0) return NULL;

crypto/mem.c:298:6: Taking false branch
      296.   	void *ret = NULL;
      297.   
      298.   	if (num <= 0) return NULL;
                  ^
      299.   
      300.   	allow_customize = 0;

crypto/mem.c:300:2: 
      298.   	if (num <= 0) return NULL;
      299.   
      300. > 	allow_customize = 0;
      301.   	if (malloc_debug_func != NULL)
      302.   		{

crypto/mem.c:301:6: Taking true branch
      299.   
      300.   	allow_customize = 0;
      301.   	if (malloc_debug_func != NULL)
                  ^
      302.   		{
      303.   		allow_customize_debug = 0;

crypto/mem.c:303:3: 
      301.   	if (malloc_debug_func != NULL)
      302.   		{
      303. > 		allow_customize_debug = 0;
      304.   		malloc_debug_func(NULL, num, file, line, 0);
      305.   		}

crypto/mem.c:304:3: Skipping __function_pointer__(): unresolved function pointer
      302.   		{
      303.   		allow_customize_debug = 0;
      304.   		malloc_debug_func(NULL, num, file, line, 0);
               ^
      305.   		}
      306.   	ret = malloc_ex_func(num,file,line);

crypto/mem.c:306:2: Skipping __function_pointer__(): unresolved function pointer
      304.   		malloc_debug_func(NULL, num, file, line, 0);
      305.   		}
      306.   	ret = malloc_ex_func(num,file,line);
              ^
      307.   #ifdef LEVITTE_DEBUG_MEM
      308.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:310:6: Taking true branch
      308.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
      309.   #endif
      310.   	if (malloc_debug_func != NULL)
                  ^
      311.   		malloc_debug_func(ret, num, file, line, 1);
      312.   

crypto/mem.c:311:3: Skipping __function_pointer__(): unresolved function pointer
      309.   #endif
      310.   	if (malloc_debug_func != NULL)
      311.   		malloc_debug_func(ret, num, file, line, 1);
               ^
      312.   
      313.   #ifndef OPENSSL_CPUID_OBJ

crypto/mem.c:317:12: Taking false branch
      315.            * sanitisation function can't be optimised out. NB: We only do
      316.            * this for >2Kb so the overhead doesn't bother us. */
      317.           if(ret && (num > 2048))
                        ^
      318.   	{	extern unsigned char cleanse_ctr;
      319.                   ((unsigned char *)ret)[0] = cleanse_ctr;

crypto/mem.c:323:2: 
      321.   #endif
      322.   
      323. > 	return ret;
      324.   	}
      325.   

crypto/mem.c:324:2: return from a call to CRYPTO_malloc
      322.   
      323.   	return ret;
      324.   	}
              ^
      325.   
      326.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/buffer/buffer.c:68:6: Taking true branch
    66.   
    67.   	ret=OPENSSL_malloc(sizeof(BUF_MEM));
    68.   	if (ret == NULL)
               ^
    69.   		{
    70.   		BUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);

crypto/buffer/buffer.c:70:3: 
    68.   	if (ret == NULL)
    69.   		{
    70. > 		BUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);
    71.   		return(NULL);
    72.   		}

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 false 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: 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/buffer/buffer.c:71:3: 
    69.   		{
    70.   		BUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);
    71. > 		return(NULL);
    72.   		}
    73.   	ret->length=0;

crypto/buffer/buffer.c:77:2: return from a call to BUF_MEM_new
    75.   	ret->data=NULL;
    76.   	return(ret);
    77.   	}
           ^
    78.   
    79.   void BUF_MEM_free(BUF_MEM *a)

crypto/x509/x509_obj.c:84:7: Taking true branch
  82.   	if (buf == NULL)
  83.   		{
  84.   		if ((b=BUF_MEM_new()) == NULL) goto err;
              ^
  85.   		if (!BUF_MEM_grow(b,200)) goto err;
  86.   		b->data[0]='\0';

crypto/x509/x509_obj.c:221:1: 
  219.   		*p = '\0';
  220.   	return(p);
  221. > err:
  222.   	X509err(X509_F_X509_NAME_ONELINE,ERR_R_MALLOC_FAILURE);
  223.   	if (b != NULL) BUF_MEM_free(b);

crypto/x509/x509_obj.c:222:2: 
  220.   	return(p);
  221.   err:
  222. > 	X509err(X509_F_X509_NAME_ONELINE,ERR_R_MALLOC_FAILURE);
  223.   	if (b != NULL) BUF_MEM_free(b);
  224.   	return(NULL);

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 false 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: 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/x509/x509_obj.c:223:6: Taking false branch
  221.   err:
  222.   	X509err(X509_F_X509_NAME_ONELINE,ERR_R_MALLOC_FAILURE);
  223.   	if (b != NULL) BUF_MEM_free(b);
              ^
  224.   	return(NULL);
  225.   	}

crypto/x509/x509_obj.c:224:2: 
  222.   	X509err(X509_F_X509_NAME_ONELINE,ERR_R_MALLOC_FAILURE);
  223.   	if (b != NULL) BUF_MEM_free(b);
  224. > 	return(NULL);
  225.   	}
  226.   

crypto/x509/x509_obj.c:225:2: return from a call to X509_NAME_oneline
  223.   	if (b != NULL) BUF_MEM_free(b);
  224.   	return(NULL);
  225.   	}
          ^
  226.   

crypto/asn1/t_x509.c:441:7: Taking false branch
439.   
440.   	b=s=X509_NAME_oneline(name,NULL,0);
441.   	if (!*s)
             ^
442.   		{
443.   		OPENSSL_free(b);

int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
	{
	char *s,*c,*b;
	int ret=0,l,i;
	l=80-2-obase;
	b=s=X509_NAME_oneline(name,NULL,0);
	if (!*s)
		{
		OPENSSL_free(b);
		return 1;
		}
	s++;
	c=s;
	for (;;)
		{
#ifndef CHARSET_EBCDIC
		if (	((*s == '/') &&
				((s[1] >= 'A') && (s[1] <= 'Z') && (
					(s[2] == '=') ||
					((s[2] >= 'A') && (s[2] <= 'Z') &&
					(s[3] == '='))
				 ))) ||
			(*s == '\0'))
#else
		if (	((*s == '/') &&
				(isupper(s[1]) && (
					(s[2] == '=') ||
					(isupper(s[2]) &&
					(s[3] == '='))
				 ))) ||
			(*s == '\0'))
#endif
			{
			i=s-c;
			if (BIO_write(bp,c,i) != i) goto err;
			c+=i;
			c++;
			if (*s != '\0')
				{
				if (BIO_write(bp,", ",2) != 2) goto err;
				}
			l--;
			}
		if (*s == '\0') break;
		s++;
		l--;
		}
	ret=1;
	if (0)
		{
err:
		X509err(X509_F_X509_NAME_PRINT,ERR_R_BUF_LIB);
		}
	OPENSSL_free(b);
	return(ret);
	}
['int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)\n\t{\n\tchar *s,*c,*b;\n\tint ret=0,l,i;\n\tl=80-2-obase;\n\tb=s=X509_NAME_oneline(name,NULL,0);\n\tif (!*s)\n\t\t{\n\t\tOPENSSL_free(b);\n\t\treturn 1;\n\t\t}\n\ts++;\n\tc=s;\n\tfor (;;)\n\t\t{\n#ifndef CHARSET_EBCDIC\n\t\tif (\t((*s == \'/\') &&\n\t\t\t\t((s[1] >= \'A\') && (s[1] <= \'Z\') && (\n\t\t\t\t\t(s[2] == \'=\') ||\n\t\t\t\t\t((s[2] >= \'A\') && (s[2] <= \'Z\') &&\n\t\t\t\t\t(s[3] == \'=\'))\n\t\t\t\t ))) ||\n\t\t\t(*s == \'\\0\'))\n#else\n\t\tif (\t((*s == \'/\') &&\n\t\t\t\t(isupper(s[1]) && (\n\t\t\t\t\t(s[2] == \'=\') ||\n\t\t\t\t\t(isupper(s[2]) &&\n\t\t\t\t\t(s[3] == \'=\'))\n\t\t\t\t ))) ||\n\t\t\t(*s == \'\\0\'))\n#endif\n\t\t\t{\n\t\t\ti=s-c;\n\t\t\tif (BIO_write(bp,c,i) != i) goto err;\n\t\t\tc+=i;\n\t\t\tc++;\n\t\t\tif (*s != \'\\0\')\n\t\t\t\t{\n\t\t\t\tif (BIO_write(bp,", ",2) != 2) goto err;\n\t\t\t\t}\n\t\t\tl--;\n\t\t\t}\n\t\tif (*s == \'\\0\') break;\n\t\ts++;\n\t\tl--;\n\t\t}\n\tret=1;\n\tif (0)\n\t\t{\nerr:\n\t\tX509err(X509_F_X509_NAME_PRINT,ERR_R_BUF_LIB);\n\t\t}\n\tOPENSSL_free(b);\n\treturn(ret);\n\t}', 'char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)\n\t{\n\tX509_NAME_ENTRY *ne;\nint i;\n\tint n,lold,l,l1,l2,num,j,type;\n\tconst char *s;\n\tchar *p;\n\tunsigned char *q;\n\tBUF_MEM *b=NULL;\n\tstatic char hex[17]="0123456789ABCDEF";\n\tint gs_doit[4];\n\tchar tmp_buf[80];\n#ifdef CHARSET_EBCDIC\n\tchar ebcdic_buf[1024];\n#endif\n\tif (buf == NULL)\n\t\t{\n\t\tif ((b=BUF_MEM_new()) == NULL) goto err;\n\t\tif (!BUF_MEM_grow(b,200)) goto err;\n\t\tb->data[0]=\'\\0\';\n\t\tlen=200;\n\t\t}\n\tif (a == NULL)\n\t    {\n\t    if(b)\n\t\t{\n\t\tbuf=b->data;\n\t\tOPENSSL_free(b);\n\t\t}\n\t    strncpy(buf,"NO X509_NAME",len);\n\t    buf[len-1]=\'\\0\';\n\t    return buf;\n\t    }\n\tlen--;\n\tl=0;\n\tfor (i=0; i<sk_X509_NAME_ENTRY_num(a->entries); i++)\n\t\t{\n\t\tne=sk_X509_NAME_ENTRY_value(a->entries,i);\n\t\tn=OBJ_obj2nid(ne->object);\n\t\tif ((n == NID_undef) || ((s=OBJ_nid2sn(n)) == NULL))\n\t\t\t{\n\t\t\ti2t_ASN1_OBJECT(tmp_buf,sizeof(tmp_buf),ne->object);\n\t\t\ts=tmp_buf;\n\t\t\t}\n\t\tl1=strlen(s);\n\t\ttype=ne->value->type;\n\t\tnum=ne->value->length;\n\t\tq=ne->value->data;\n#ifdef CHARSET_EBCDIC\n                if (type == V_ASN1_GENERALSTRING ||\n\t\t    type == V_ASN1_VISIBLESTRING ||\n\t\t    type == V_ASN1_PRINTABLESTRING ||\n\t\t    type == V_ASN1_TELETEXSTRING ||\n\t\t    type == V_ASN1_VISIBLESTRING ||\n\t\t    type == V_ASN1_IA5STRING) {\n                        ascii2ebcdic(ebcdic_buf, q,\n\t\t\t\t     (num > sizeof ebcdic_buf)\n\t\t\t\t     ? sizeof ebcdic_buf : num);\n                        q=ebcdic_buf;\n\t\t}\n#endif\n\t\tif ((type == V_ASN1_GENERALSTRING) && ((num%4) == 0))\n\t\t\t{\n\t\t\tgs_doit[0]=gs_doit[1]=gs_doit[2]=gs_doit[3]=0;\n\t\t\tfor (j=0; j<num; j++)\n\t\t\t\tif (q[j] != 0) gs_doit[j&3]=1;\n\t\t\tif (gs_doit[0]|gs_doit[1]|gs_doit[2])\n\t\t\t\tgs_doit[0]=gs_doit[1]=gs_doit[2]=gs_doit[3]=1;\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tgs_doit[0]=gs_doit[1]=gs_doit[2]=0;\n\t\t\t\tgs_doit[3]=1;\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\tgs_doit[0]=gs_doit[1]=gs_doit[2]=gs_doit[3]=1;\n\t\tfor (l2=j=0; j<num; j++)\n\t\t\t{\n\t\t\tif (!gs_doit[j&3]) continue;\n\t\t\tl2++;\n#ifndef CHARSET_EBCDIC\n\t\t\tif ((q[j] < \' \') || (q[j] > \'~\')) l2+=3;\n#else\n\t\t\tif ((os_toascii[q[j]] < os_toascii[\' \']) ||\n\t\t\t    (os_toascii[q[j]] > os_toascii[\'~\'])) l2+=3;\n#endif\n\t\t\t}\n\t\tlold=l;\n\t\tl+=1+l1+1+l2;\n\t\tif (b != NULL)\n\t\t\t{\n\t\t\tif (!BUF_MEM_grow(b,l+1)) goto err;\n\t\t\tp= &(b->data[lold]);\n\t\t\t}\n\t\telse if (l > len)\n\t\t\t{\n\t\t\tbreak;\n\t\t\t}\n\t\telse\n\t\t\tp= &(buf[lold]);\n\t\t*(p++)=\'/\';\n\t\tmemcpy(p,s,(unsigned int)l1); p+=l1;\n\t\t*(p++)=\'=\';\n#ifndef CHARSET_EBCDIC\n\t\tq=ne->value->data;\n#endif\n\t\tfor (j=0; j<num; j++)\n\t\t\t{\n\t\t\tif (!gs_doit[j&3]) continue;\n#ifndef CHARSET_EBCDIC\n\t\t\tn=q[j];\n\t\t\tif ((n < \' \') || (n > \'~\'))\n\t\t\t\t{\n\t\t\t\t*(p++)=\'\\\\\';\n\t\t\t\t*(p++)=\'x\';\n\t\t\t\t*(p++)=hex[(n>>4)&0x0f];\n\t\t\t\t*(p++)=hex[n&0x0f];\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t*(p++)=n;\n#else\n\t\t\tn=os_toascii[q[j]];\n\t\t\tif ((n < os_toascii[\' \']) ||\n\t\t\t    (n > os_toascii[\'~\']))\n\t\t\t\t{\n\t\t\t\t*(p++)=\'\\\\\';\n\t\t\t\t*(p++)=\'x\';\n\t\t\t\t*(p++)=hex[(n>>4)&0x0f];\n\t\t\t\t*(p++)=hex[n&0x0f];\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t*(p++)=q[j];\n#endif\n\t\t\t}\n\t\t*p=\'\\0\';\n\t\t}\n\tif (b != NULL)\n\t\t{\n\t\tp=b->data;\n\t\tOPENSSL_free(b);\n\t\t}\n\telse\n\t\tp=buf;\n\tif (i == 0)\n\t\t*p = \'\\0\';\n\treturn(p);\nerr:\n\tX509err(X509_F_X509_NAME_ONELINE,ERR_R_MALLOC_FAILURE);\n\tif (b != NULL) BUF_MEM_free(b);\n\treturn(NULL);\n\t}', 'BUF_MEM *BUF_MEM_new(void)\n\t{\n\tBUF_MEM *ret;\n\tret=OPENSSL_malloc(sizeof(BUF_MEM));\n\tif (ret == NULL)\n\t\t{\n\t\tBUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tret->length=0;\n\tret->max=0;\n\tret->data=NULL;\n\treturn(ret);\n\t}', 'void *CRYPTO_malloc(int num, const char *file, int line)\n\t{\n\tvoid *ret = NULL;\n\tif (num <= 0) return NULL;\n\tallow_customize = 0;\n\tif (malloc_debug_func != NULL)\n\t\t{\n\t\tallow_customize_debug = 0;\n\t\tmalloc_debug_func(NULL, num, file, line, 0);\n\t\t}\n\tret = malloc_ex_func(num,file,line);\n#ifdef LEVITTE_DEBUG_MEM\n\tfprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\\n", ret, num);\n#endif\n\tif (malloc_debug_func != NULL)\n\t\tmalloc_debug_func(ret, num, file, line, 1);\n#ifndef OPENSSL_CPUID_OBJ\n        if(ret && (num > 2048))\n\t{\textern unsigned char cleanse_ctr;\n                ((unsigned char *)ret)[0] = cleanse_ctr;\n\t}\n#endif\n\treturn ret;\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}']