apps/pkcs12.c:772: error: NULL_DEREFERENCE
  pointer `av` last assigned on line 771 could be null and is dereferenced at line 772, column 11.
Showing all 64 steps of the trace


apps/pkcs12.c:746:1: start of procedure print_attribs()
744.   /* Generalised attribute print: handle PKCS#8 and bag attributes */
745.   
746. > int print_attribs (BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst, char *name)
747.   {
748.   	X509_ATTRIBUTE *attr;

apps/pkcs12.c:752:6: Taking false branch
750.   	char *value;
751.   	int i, attr_nid;
752.   	if(!attrlst) {
            ^
753.   		BIO_printf(out, "%s: <No Attributes>\n", name);
754.   		return 1;

apps/pkcs12.c:756:6: 
754.   		return 1;
755.   	}
756. > 	if(!sk_X509_ATTRIBUTE_num(attrlst)) {
757.   		BIO_printf(out, "%s: <Empty Attributes>\n", name);
758.   		return 1;

crypto/stack/stack.c:299:1: start of procedure sk_num()
  297.   	}
  298.   
  299. > int sk_num(const STACK *st)
  300.   {
  301.   	if(st == NULL) return -1;

crypto/stack/stack.c:301:5: Taking false branch
  299.   int sk_num(const STACK *st)
  300.   {
  301.   	if(st == NULL) return -1;
             ^
  302.   	return st->num;
  303.   }

crypto/stack/stack.c:302:2: 
  300.   {
  301.   	if(st == NULL) return -1;
  302. > 	return st->num;
  303.   }
  304.   

crypto/stack/stack.c:303:1: return from a call to sk_num
  301.   	if(st == NULL) return -1;
  302.   	return st->num;
  303. > }
  304.   
  305.   char *sk_value(const STACK *st, int i)

apps/pkcs12.c:756:6: Taking false branch
754.   		return 1;
755.   	}
756.   	if(!sk_X509_ATTRIBUTE_num(attrlst)) {
            ^
757.   		BIO_printf(out, "%s: <Empty Attributes>\n", name);
758.   		return 1;

apps/pkcs12.c:760:2: Skipping BIO_printf(): empty list of specs
758.   		return 1;
759.   	}
760.   	BIO_printf(out, "%s\n", name);
        ^
761.   	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);

apps/pkcs12.c:761:6: 
759.   	}
760.   	BIO_printf(out, "%s\n", name);
761. > 	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763.   		attr_nid = OBJ_obj2nid(attr->object);

apps/pkcs12.c:761:13: 
759.   	}
760.   	BIO_printf(out, "%s\n", name);
761. > 	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763.   		attr_nid = OBJ_obj2nid(attr->object);

crypto/stack/stack.c:299:1: start of procedure sk_num()
  297.   	}
  298.   
  299. > int sk_num(const STACK *st)
  300.   {
  301.   	if(st == NULL) return -1;

crypto/stack/stack.c:301:5: Taking false branch
  299.   int sk_num(const STACK *st)
  300.   {
  301.   	if(st == NULL) return -1;
             ^
  302.   	return st->num;
  303.   }

crypto/stack/stack.c:302:2: 
  300.   {
  301.   	if(st == NULL) return -1;
  302. > 	return st->num;
  303.   }
  304.   

crypto/stack/stack.c:303:1: return from a call to sk_num
  301.   	if(st == NULL) return -1;
  302.   	return st->num;
  303. > }
  304.   
  305.   char *sk_value(const STACK *st, int i)

apps/pkcs12.c:761:13: Loop condition is true. Entering loop body
759.   	}
760.   	BIO_printf(out, "%s\n", name);
761.   	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
                   ^
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763.   		attr_nid = OBJ_obj2nid(attr->object);

apps/pkcs12.c:762:3: 
760.   	BIO_printf(out, "%s\n", name);
761.   	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
762. > 		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763.   		attr_nid = OBJ_obj2nid(attr->object);
764.   		BIO_printf(out, "    ");

crypto/stack/stack.c:305:1: start of procedure sk_value()
  303.   }
  304.   
  305. > char *sk_value(const STACK *st, int i)
  306.   {
  307.   	if(st == NULL) return NULL;

crypto/stack/stack.c:307:5: Taking false branch
  305.   char *sk_value(const STACK *st, int i)
  306.   {
  307.   	if(st == NULL) return NULL;
             ^
  308.   	return st->data[i];
  309.   }

crypto/stack/stack.c:308:2: 
  306.   {
  307.   	if(st == NULL) return NULL;
  308. > 	return st->data[i];
  309.   }
  310.   

crypto/stack/stack.c:309:1: return from a call to sk_value
  307.   	if(st == NULL) return NULL;
  308.   	return st->data[i];
  309. > }
  310.   
  311.   char *sk_set(STACK *st, int i, char *value)

apps/pkcs12.c:763:3: 
761.   	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763. > 		attr_nid = OBJ_obj2nid(attr->object);
764.   		BIO_printf(out, "    ");
765.   		if(attr_nid == NID_undef) {

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 true 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:356:3: 
  354.   
  355.   	if (a == NULL)
  356. > 		return(NID_undef);
  357.   	if (a->nid != 0)
  358.   		return(a->nid);

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

apps/pkcs12.c:764:3: Skipping BIO_printf(): empty list of specs
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763.   		attr_nid = OBJ_obj2nid(attr->object);
764.   		BIO_printf(out, "    ");
         ^
765.   		if(attr_nid == NID_undef) {
766.   			i2a_ASN1_OBJECT (out, attr->object);

apps/pkcs12.c:765:6: Taking true branch
763.   		attr_nid = OBJ_obj2nid(attr->object);
764.   		BIO_printf(out, "    ");
765.   		if(attr_nid == NID_undef) {
            ^
766.   			i2a_ASN1_OBJECT (out, attr->object);
767.   			BIO_printf(out, ": ");

apps/pkcs12.c:766:4: 
764.   		BIO_printf(out, "    ");
765.   		if(attr_nid == NID_undef) {
766. > 			i2a_ASN1_OBJECT (out, attr->object);
767.   			BIO_printf(out, ": ");
768.   		} else BIO_printf(out, "%s: ", OBJ_nid2ln(attr_nid));

crypto/asn1/a_object.c:178:1: start of procedure i2a_ASN1_OBJECT()
  176.   }
  177.   
  178. > int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a)
  179.   	{
  180.   	char buf[80];

crypto/asn1/a_object.c:183:7: Taking true branch
  181.   	int i;
  182.   
  183.   	if ((a == NULL) || (a->data == NULL))
               ^
  184.   		return(BIO_write(bp,"NULL",4));
  185.   	i=i2t_ASN1_OBJECT(buf,80,a);

crypto/asn1/a_object.c:184:3: 
  182.   
  183.   	if ((a == NULL) || (a->data == NULL))
  184. > 		return(BIO_write(bp,"NULL",4));
  185.   	i=i2t_ASN1_OBJECT(buf,80,a);
  186.   	if (i > 80) i=80;

crypto/bio/bio_lib.c:175:1: start of procedure BIO_write()
    173.   	}
    174.   
    175. > int BIO_write(BIO *b, const void *in, int inl)
    176.   	{
    177.   	int i;

crypto/bio/bio_lib.c:180:6: Taking false branch
    178.   	long (*cb)();
    179.   
    180.   	if (b == NULL)
                ^
    181.   		return(0);
    182.   

crypto/bio/bio_lib.c:183:2: 
    181.   		return(0);
    182.   
    183. > 	cb=b->callback;
    184.   	if ((b->method == NULL) || (b->method->bwrite == NULL))
    185.   		{

crypto/bio/bio_lib.c:184:7: Taking false branch
    182.   
    183.   	cb=b->callback;
    184.   	if ((b->method == NULL) || (b->method->bwrite == NULL))
                 ^
    185.   		{
    186.   		BIOerr(BIO_F_BIO_WRITE,BIO_R_UNSUPPORTED_METHOD);

crypto/bio/bio_lib.c:184:30: Taking true branch
    182.   
    183.   	cb=b->callback;
    184.   	if ((b->method == NULL) || (b->method->bwrite == NULL))
                                        ^
    185.   		{
    186.   		BIOerr(BIO_F_BIO_WRITE,BIO_R_UNSUPPORTED_METHOD);

crypto/bio/bio_lib.c:186:3: 
    184.   	if ((b->method == NULL) || (b->method->bwrite == NULL))
    185.   		{
    186. > 		BIOerr(BIO_F_BIO_WRITE,BIO_R_UNSUPPORTED_METHOD);
    187.   		return(-2);
    188.   		}

crypto/err/err.c:353:1: start of procedure ERR_put_error()
      351.   /********************************************************/
      352.   
      353. > void ERR_put_error(int lib, int func, int reason, const char *file,
      354.   	     int line)
      355.   	{

crypto/err/err.c:377:2: Skipping ERR_get_state(): empty list of specs
      375.   	}
      376.   #endif
      377.   	es=ERR_get_state();
              ^
      378.   
      379.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:379:2: 
      377.   	es=ERR_get_state();
      378.   
      379. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
      380.   	if (es->top == es->bottom)
      381.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:380:6: Taking false branch
      378.   
      379.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
      380.   	if (es->top == es->bottom)
                  ^
      381.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      382.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:382:2: 
      380.   	if (es->top == es->bottom)
      381.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      382. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      383.   	es->err_file[es->top]=file;
      384.   	es->err_line[es->top]=line;

crypto/err/err.c:383:2: 
      381.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      382.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      383. > 	es->err_file[es->top]=file;
      384.   	es->err_line[es->top]=line;
      385.   	err_clear_data(es,es->top);

crypto/err/err.c:384:2: 
      382.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      383.   	es->err_file[es->top]=file;
      384. > 	es->err_line[es->top]=line;
      385.   	err_clear_data(es,es->top);
      386.   	}

crypto/err/err.c:385:2: Taking true branch
      383.   	es->err_file[es->top]=file;
      384.   	es->err_line[es->top]=line;
      385.   	err_clear_data(es,es->top);
              ^
      386.   	}
      387.   

crypto/err/err.c:385:2: Taking false branch
      383.   	es->err_file[es->top]=file;
      384.   	es->err_line[es->top]=line;
      385.   	err_clear_data(es,es->top);
              ^
      386.   	}
      387.   

crypto/err/err.c:386:2: return from a call to ERR_put_error
      384.   	es->err_line[es->top]=line;
      385.   	err_clear_data(es,es->top);
      386.   	}
              ^
      387.   
      388.   void ERR_clear_error(void)

crypto/bio/bio_lib.c:187:3: 
    185.   		{
    186.   		BIOerr(BIO_F_BIO_WRITE,BIO_R_UNSUPPORTED_METHOD);
    187. > 		return(-2);
    188.   		}
    189.   

crypto/bio/bio_lib.c:214:2: return from a call to BIO_write
    212.   			0L,(long)i);
    213.   	return(i);
    214.   	}
            ^
    215.   
    216.   int BIO_puts(BIO *b, const char *in)

crypto/asn1/a_object.c:189:2: return from a call to i2a_ASN1_OBJECT
  187.   	BIO_write(bp,buf,i);
  188.   	return(i);
  189.   	}
          ^
  190.   
  191.   ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,

apps/pkcs12.c:767:4: Skipping BIO_printf(): empty list of specs
765.   		if(attr_nid == NID_undef) {
766.   			i2a_ASN1_OBJECT (out, attr->object);
767.   			BIO_printf(out, ": ");
          ^
768.   		} else BIO_printf(out, "%s: ", OBJ_nid2ln(attr_nid));
769.   

apps/pkcs12.c:770:6: 
768.   		} else BIO_printf(out, "%s: ", OBJ_nid2ln(attr_nid));
769.   
770. > 		if(sk_ASN1_TYPE_num(attr->value.set)) {
771.   			av = sk_ASN1_TYPE_value(attr->value.set, 0);
772.   			switch(av->type) {

crypto/stack/stack.c:299:1: start of procedure sk_num()
  297.   	}
  298.   
  299. > int sk_num(const STACK *st)
  300.   {
  301.   	if(st == NULL) return -1;

crypto/stack/stack.c:301:5: Taking true branch
  299.   int sk_num(const STACK *st)
  300.   {
  301.   	if(st == NULL) return -1;
             ^
  302.   	return st->num;
  303.   }

crypto/stack/stack.c:301:17: 
  299.   int sk_num(const STACK *st)
  300.   {
  301. > 	if(st == NULL) return -1;
  302.   	return st->num;
  303.   }

crypto/stack/stack.c:303:1: return from a call to sk_num
  301.   	if(st == NULL) return -1;
  302.   	return st->num;
  303. > }
  304.   
  305.   char *sk_value(const STACK *st, int i)

apps/pkcs12.c:770:6: Taking true branch
768.   		} else BIO_printf(out, "%s: ", OBJ_nid2ln(attr_nid));
769.   
770.   		if(sk_ASN1_TYPE_num(attr->value.set)) {
            ^
771.   			av = sk_ASN1_TYPE_value(attr->value.set, 0);
772.   			switch(av->type) {

apps/pkcs12.c:771:4: 
769.   
770.   		if(sk_ASN1_TYPE_num(attr->value.set)) {
771. > 			av = sk_ASN1_TYPE_value(attr->value.set, 0);
772.   			switch(av->type) {
773.   				case V_ASN1_BMPSTRING:

crypto/stack/stack.c:305:1: start of procedure sk_value()
  303.   }
  304.   
  305. > char *sk_value(const STACK *st, int i)
  306.   {
  307.   	if(st == NULL) return NULL;

crypto/stack/stack.c:307:5: Taking true branch
  305.   char *sk_value(const STACK *st, int i)
  306.   {
  307.   	if(st == NULL) return NULL;
             ^
  308.   	return st->data[i];
  309.   }

crypto/stack/stack.c:307:17: 
  305.   char *sk_value(const STACK *st, int i)
  306.   {
  307. > 	if(st == NULL) return NULL;
  308.   	return st->data[i];
  309.   }

crypto/stack/stack.c:309:1: return from a call to sk_value
  307.   	if(st == NULL) return NULL;
  308.   	return st->data[i];
  309. > }
  310.   
  311.   char *sk_set(STACK *st, int i, char *value)

apps/pkcs12.c:772:4: 
770.   		if(sk_ASN1_TYPE_num(attr->value.set)) {
771.   			av = sk_ASN1_TYPE_value(attr->value.set, 0);
772. > 			switch(av->type) {
773.   				case V_ASN1_BMPSTRING:
774.           			value = uni2asc(av->value.bmpstring->data,

int print_attribs (BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst, char *name)
{
	X509_ATTRIBUTE *attr;
	ASN1_TYPE *av;
	char *value;
	int i, attr_nid;
	if(!attrlst) {
		BIO_printf(out, "%s: <No Attributes>\n", name);
		return 1;
	}
	if(!sk_X509_ATTRIBUTE_num(attrlst)) {
		BIO_printf(out, "%s: <Empty Attributes>\n", name);
		return 1;
	}
	BIO_printf(out, "%s\n", name);
	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
		attr_nid = OBJ_obj2nid(attr->object);
		BIO_printf(out, "    ");
		if(attr_nid == NID_undef) {
			i2a_ASN1_OBJECT (out, attr->object);
			BIO_printf(out, ": ");
		} else BIO_printf(out, "%s: ", OBJ_nid2ln(attr_nid));
		if(sk_ASN1_TYPE_num(attr->value.set)) {
			av = sk_ASN1_TYPE_value(attr->value.set, 0);
			switch(av->type) {
				case V_ASN1_BMPSTRING:
        			value = uni2asc(av->value.bmpstring->data,
                                	       av->value.bmpstring->length);
				BIO_printf(out, "%s\n", value);
				OPENSSL_free(value);
				break;
				case V_ASN1_OCTET_STRING:
				hex_prin(out, av->value.bit_string->data,
					av->value.bit_string->length);
				BIO_printf(out, "\n");
				break;
				case V_ASN1_BIT_STRING:
				hex_prin(out, av->value.octet_string->data,
					av->value.octet_string->length);
				BIO_printf(out, "\n");
				break;
				default:
					BIO_printf(out, "<Unsupported tag %d>\n", av->type);
				break;
			}
		} else BIO_printf(out, "<No Values>\n");
	}
	return 1;
}
['int print_attribs (BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst, char *name)\n{\n\tX509_ATTRIBUTE *attr;\n\tASN1_TYPE *av;\n\tchar *value;\n\tint i, attr_nid;\n\tif(!attrlst) {\n\t\tBIO_printf(out, "%s: <No Attributes>\\n", name);\n\t\treturn 1;\n\t}\n\tif(!sk_X509_ATTRIBUTE_num(attrlst)) {\n\t\tBIO_printf(out, "%s: <Empty Attributes>\\n", name);\n\t\treturn 1;\n\t}\n\tBIO_printf(out, "%s\\n", name);\n\tfor(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {\n\t\tattr = sk_X509_ATTRIBUTE_value(attrlst, i);\n\t\tattr_nid = OBJ_obj2nid(attr->object);\n\t\tBIO_printf(out, "    ");\n\t\tif(attr_nid == NID_undef) {\n\t\t\ti2a_ASN1_OBJECT (out, attr->object);\n\t\t\tBIO_printf(out, ": ");\n\t\t} else BIO_printf(out, "%s: ", OBJ_nid2ln(attr_nid));\n\t\tif(sk_ASN1_TYPE_num(attr->value.set)) {\n\t\t\tav = sk_ASN1_TYPE_value(attr->value.set, 0);\n\t\t\tswitch(av->type) {\n\t\t\t\tcase V_ASN1_BMPSTRING:\n        \t\t\tvalue = uni2asc(av->value.bmpstring->data,\n                                \t       av->value.bmpstring->length);\n\t\t\t\tBIO_printf(out, "%s\\n", value);\n\t\t\t\tOPENSSL_free(value);\n\t\t\t\tbreak;\n\t\t\t\tcase V_ASN1_OCTET_STRING:\n\t\t\t\thex_prin(out, av->value.bit_string->data,\n\t\t\t\t\tav->value.bit_string->length);\n\t\t\t\tBIO_printf(out, "\\n");\n\t\t\t\tbreak;\n\t\t\t\tcase V_ASN1_BIT_STRING:\n\t\t\t\thex_prin(out, av->value.octet_string->data,\n\t\t\t\t\tav->value.octet_string->length);\n\t\t\t\tBIO_printf(out, "\\n");\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tBIO_printf(out, "<Unsupported tag %d>\\n", av->type);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else BIO_printf(out, "<No Values>\\n");\n\t}\n\treturn 1;\n}', 'int sk_num(const STACK *st)\n{\n\tif(st == NULL) return -1;\n\treturn st->num;\n}', 'char *sk_value(const STACK *st, int i)\n{\n\tif(st == NULL) return NULL;\n\treturn st->data[i];\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,&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}', 'int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a)\n\t{\n\tchar buf[80];\n\tint i;\n\tif ((a == NULL) || (a->data == NULL))\n\t\treturn(BIO_write(bp,"NULL",4));\n\ti=i2t_ASN1_OBJECT(buf,80,a);\n\tif (i > 80) i=80;\n\tBIO_write(bp,buf,i);\n\treturn(i);\n\t}', 'int BIO_write(BIO *b, const void *in, int inl)\n\t{\n\tint i;\n\tlong (*cb)();\n\tif (b == NULL)\n\t\treturn(0);\n\tcb=b->callback;\n\tif ((b->method == NULL) || (b->method->bwrite == NULL))\n\t\t{\n\t\tBIOerr(BIO_F_BIO_WRITE,BIO_R_UNSUPPORTED_METHOD);\n\t\treturn(-2);\n\t\t}\n\tif ((cb != NULL) &&\n\t\t((i=(int)cb(b,BIO_CB_WRITE,in,inl,0L,1L)) <= 0))\n\t\t\treturn(i);\n\tif (!b->init)\n\t\t{\n\t\tBIOerr(BIO_F_BIO_WRITE,BIO_R_UNINITIALIZED);\n\t\treturn(-2);\n\t\t}\n\ti=b->method->bwrite(b,in,inl);\n\tif (i > 0) b->num_write+=(unsigned long)i;\n\tif (b->references <= 0) abort();\n\tif (cb != NULL)\n\t\ti=(int)cb(b,BIO_CB_WRITE|BIO_CB_RETURN,in,inl,\n\t\t\t0L,(long)i);\n\treturn(i);\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}']