apps/pkcs12.c:383: error: BUFFER_OVERRUN_L3
  Offset: [0, 1] Size: [0, +oo] by call to `ASN1_seq_pack`.
Showing all 22 steps of the trace


apps/pkcs12.c:374:9: Call
372.           if (name) PKCS12_add_friendlyname (bag, name, -1);
373.   	PKCS12_add_localkeyid (bag, keyid, keyidlen);
374.   	bags = sk_new(NULL);
               ^
375.   	sk_push (bags, (char *)bag);
376.   	/* Turn it into unencrypted safe bag */

crypto/stack/stack.c:119:26: Array declaration
  117.   	if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL)
  118.   		goto err0;
  119.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)
                                  ^
  120.   		goto err1;
  121.   	for (i=0; i<MIN_NODES; i++)

crypto/stack/stack.c:119:7: Assignment
  117.   	if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL)
  118.   		goto err0;
  119.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)
               ^
  120.   		goto err1;
  121.   	for (i=0; i<MIN_NODES; i++)

apps/pkcs12.c:375:2: Call
373.   	PKCS12_add_localkeyid (bag, keyid, keyidlen);
374.   	bags = sk_new(NULL);
375.   	sk_push (bags, (char *)bag);
        ^
376.   	/* Turn it into unencrypted safe bag */
377.   	authsafe = PKCS12_pack_p7data (bags);

crypto/stack/stack.c:237:1: Parameter `*st->data`
  235.   	}
  236.   
  237. > int sk_push(STACK *st, char *data)
  238.   	{
  239.   	return(sk_insert(st,data,st->num));

crypto/stack/stack.c:239:9: Call
  237.   int sk_push(STACK *st, char *data)
  238.   	{
  239.   	return(sk_insert(st,data,st->num));
                 ^
  240.   	}
  241.   

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

apps/pkcs12.c:378:2: Call
376.   	/* Turn it into unencrypted safe bag */
377.   	authsafe = PKCS12_pack_p7data (bags);
378.   	sk_pop_free(bags, PKCS12_SAFEBAG_free);
        ^
379.   	sk_push (safes, (char *)authsafe);
380.   

crypto/stack/stack.c:269:1: Parameter `*st->data`
  267.   	}
  268.   
  269. > void sk_pop_free(STACK *st, void (*func)())
  270.   	{
  271.   	int i;

apps/pkcs12.c:379:2: Call
377.   	authsafe = PKCS12_pack_p7data (bags);
378.   	sk_pop_free(bags, PKCS12_SAFEBAG_free);
379.   	sk_push (safes, (char *)authsafe);
        ^
380.   
381.   	p12 = PKCS12_init (NID_pkcs7_data);

crypto/stack/stack.c:237:1: Parameter `*st->data`
  235.   	}
  236.   
  237. > int sk_push(STACK *st, char *data)
  238.   	{
  239.   	return(sk_insert(st,data,st->num));

crypto/stack/stack.c:239:9: Call
  237.   int sk_push(STACK *st, char *data)
  238.   	{
  239.   	return(sk_insert(st,data,st->num));
                 ^
  240.   	}
  241.   

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

apps/pkcs12.c:383:2: Call
381.   	p12 = PKCS12_init (NID_pkcs7_data);
382.   
383.   	M_PKCS12_pack_authsafes (p12, safes);
        ^
384.   
385.   	sk_pop_free(safes, PKCS7_free);

crypto/asn1/asn_pack.c:83:1: Parameter `*safes->data`
  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:86:1: <Offset 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:97:7: Assignment
    95.   
    96.   	if (a == NULL) return(0);
    97.   	for (i=sk_num(a)-1; i>=0; i--)
                 ^
    98.   		ret+=func(sk_value(a,i),NULL);
    99.   	r=ASN1_object_size(1,ret,ex_tag);

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->data`
    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:98:13: Array access: Offset: [0, 1] Size: [0, +oo] by call to `ASN1_seq_pack` 
    96.   	if (a == NULL) return(0);
    97.   	for (i=sk_num(a)-1; i>=0; i--)
    98.   		ret+=func(sk_value(a,i),NULL);
                       ^
    99.   	r=ASN1_object_size(1,ret,ex_tag);
    100.   	if (pp == NULL) return(r);
