apps/pkcs12.c:407: error: BUFFER_OVERRUN_L3
  Offset: [0, 1] Size: [0, 2] by call to `ASN1_seq_pack`.
Showing all 24 steps of the trace


apps/pkcs12.c:398:9: Call
396.           if (name) PKCS12_add_friendlyname (bag, name, -1);
397.   	PKCS12_add_localkeyid (bag, keyid, keyidlen);
398.   	bags = sk_new(NULL);
               ^
399.   	sk_push (bags, (char *)bag);
400.   	/* Turn it into unencrypted safe bag */

crypto/stack/stack.c:125:2: Assignment
  123.   	ret->comp=c;
  124.   	ret->num_alloc=MIN_NODES;
  125.   	ret->num=0;
          ^
  126.   	ret->sorted=0;
  127.   	return(ret);

apps/pkcs12.c:399:2: Call
397.   	PKCS12_add_localkeyid (bag, keyid, keyidlen);
398.   	bags = sk_new(NULL);
399.   	sk_push (bags, (char *)bag);
        ^
400.   	/* Turn it into unencrypted safe bag */
401.   	authsafe = PKCS12_pack_p7data (bags);

crypto/stack/stack.c:233:1: Parameter `st->num`
  231.   	}
  232.   
  233. > int sk_push(STACK *st, char *data)
  234.   	{
  235.   	return(sk_insert(st,data,st->num));

crypto/stack/stack.c:235:9: Call
  233.   int sk_push(STACK *st, char *data)
  234.   	{
  235.   	return(sk_insert(st,data,st->num));
                 ^
  236.   	}
  237.   

crypto/stack/stack.c:134:1: Parameter `st->num`
    132.   	}
    133.   
    134. > int sk_insert(STACK *st, char *data, int loc)
    135.   	{
    136.   	char **s;

apps/pkcs12.c:402:2: Call
400.   	/* Turn it into unencrypted safe bag */
401.   	authsafe = PKCS12_pack_p7data (bags);
402.   	sk_pop_free(bags, PKCS12_SAFEBAG_free);
        ^
403.   	sk_push (safes, (char *)authsafe);
404.   

crypto/stack/stack.c:265:1: Parameter `st->num`
  263.   	}
  264.   
  265. > void sk_pop_free(STACK *st, void (*func)())
  266.   	{
  267.   	int i;

apps/pkcs12.c:403:2: Call
401.   	authsafe = PKCS12_pack_p7data (bags);
402.   	sk_pop_free(bags, PKCS12_SAFEBAG_free);
403.   	sk_push (safes, (char *)authsafe);
        ^
404.   
405.   	p12 = PKCS12_init (NID_pkcs7_data);

crypto/stack/stack.c:233:1: Parameter `st->num`
  231.   	}
  232.   
  233. > int sk_push(STACK *st, char *data)
  234.   	{
  235.   	return(sk_insert(st,data,st->num));

crypto/stack/stack.c:235:9: Call
  233.   int sk_push(STACK *st, char *data)
  234.   	{
  235.   	return(sk_insert(st,data,st->num));
                 ^
  236.   	}
  237.   

crypto/stack/stack.c:134:1: Parameter `st->num`
    132.   	}
    133.   
    134. > int sk_insert(STACK *st, char *data, int loc)
    135.   	{
    136.   	char **s;

apps/pkcs12.c:407:2: Call
405.   	p12 = PKCS12_init (NID_pkcs7_data);
406.   
407.   	M_PKCS12_pack_authsafes (p12, safes);
        ^
408.   
409.   	sk_pop_free(safes, PKCS7_free);

crypto/asn1/asn_pack.c:83:1: Parameter `safes->num`
  81.    */
  82.   
  83. > unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf,
  84.   	     int *len)
  85.   {

crypto/asn1/asn_pack.c:88:18: Call
  86.   	int safelen;
  87.   	unsigned char *safe, *p;
  88.   	if (!(safelen = i2d_ASN1_SET(safes, NULL, i2d, V_ASN1_SEQUENCE,
                         ^
  89.   					      V_ASN1_UNIVERSAL, IS_SEQUENCE))) {
  90.   		ASN1err(ASN1_F_ASN1_SEQ_PACK,ASN1_R_ENCODE_ERROR);

crypto/asn1/a_set.c:122:14: <Offset trace>
120.   we will store the SET blobs */
121.   
122.           for (i=0; i<sk_num(a); i++)
                    ^
123.   	        {
124.                   rgSetBlob[i].pbData = p;  /* catch each set encode blob */

crypto/asn1/a_set.c:122:14: Assignment
    120.   we will store the SET blobs */
    121.   
    122.           for (i=0; i<sk_num(a); i++)
                        ^
    123.   	        {
    124.                   rgSetBlob[i].pbData = p;  /* catch each set encode blob */

crypto/asn1/a_set.c:86:1: <Length trace>
84.   
85.   /* int is_set:  if TRUE, then sort the contents (i.e. it isn't a SEQUENCE)    */
86. > int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(), int ex_tag,
87.   	     int ex_class, int is_set)
88.   	{

crypto/asn1/a_set.c:86:1: Parameter `a->num`
    84.   
    85.   /* int is_set:  if TRUE, then sort the contents (i.e. it isn't a SEQUENCE)    */
    86. > int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(), int ex_tag,
    87.   	     int ex_class, int is_set)
    88.   	{

crypto/asn1/a_set.c:119:39: Call
    117.   
    118.           pStart  = p; /* Catch the beg of Setblobs*/
    119.           rgSetBlob = (MYBLOB *)Malloc( sk_num(a) * sizeof(MYBLOB)); /* In this array
                                                 ^
    120.   we will store the SET blobs */
    121.   

crypto/stack/stack.c:285:17: Assignment
      283.   int sk_num(STACK *st)
      284.   {
      285.   	if(st == NULL) return -1;
                             ^
      286.   	return st->num;
      287.   }

crypto/asn1/a_set.c:119:31: Array declaration
    117.   
    118.           pStart  = p; /* Catch the beg of Setblobs*/
    119.           rgSetBlob = (MYBLOB *)Malloc( sk_num(a) * sizeof(MYBLOB)); /* In this array
                                         ^
    120.   we will store the SET blobs */
    121.   

crypto/asn1/a_set.c:119:9: Assignment
    117.   
    118.           pStart  = p; /* Catch the beg of Setblobs*/
    119.           rgSetBlob = (MYBLOB *)Malloc( sk_num(a) * sizeof(MYBLOB)); /* In this array
                   ^
    120.   we will store the SET blobs */
    121.   

crypto/asn1/a_set.c:124:17: Array access: Offset: [0, 1] Size: [0, 2] by call to `ASN1_seq_pack` 
    122.           for (i=0; i<sk_num(a); i++)
    123.   	        {
    124.                   rgSetBlob[i].pbData = p;  /* catch each set encode blob */
                           ^
    125.                   func(sk_value(a,i),&p);
    126.                   rgSetBlob[i].cbData = p - rgSetBlob[i].pbData; /* Length of this
