apps/pkcs12.c:394: 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:385:9: Call
383.           if (name) PKCS12_add_friendlyname (bag, name, -1);
384.   	PKCS12_add_localkeyid (bag, keyid, keyidlen);
385.   	bags = sk_new(NULL);
               ^
386.   	sk_push (bags, (char *)bag);
387.   	/* Turn it into unencrypted safe bag */

crypto/stack/stack.c:124:26: Array declaration
  122.   	if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL)
  123.   		goto err0;
  124.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)
                                  ^
  125.   		goto err1;
  126.   	for (i=0; i<MIN_NODES; i++)

crypto/stack/stack.c:124:7: Assignment
  122.   	if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL)
  123.   		goto err0;
  124.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)
               ^
  125.   		goto err1;
  126.   	for (i=0; i<MIN_NODES; i++)

apps/pkcs12.c:386:2: Call
384.   	PKCS12_add_localkeyid (bag, keyid, keyidlen);
385.   	bags = sk_new(NULL);
386.   	sk_push (bags, (char *)bag);
        ^
387.   	/* Turn it into unencrypted safe bag */
388.   	authsafe = PKCS12_pack_p7data (bags);

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

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

crypto/stack/stack.c:139:1: Parameter `*st->data`
    137.   	}
    138.   
    139. > int sk_insert(STACK *st, char *data, int loc)
    140.   	{
    141.   	char **s;

apps/pkcs12.c:389:2: Call
387.   	/* Turn it into unencrypted safe bag */
388.   	authsafe = PKCS12_pack_p7data (bags);
389.   	sk_pop_free(bags, PKCS12_SAFEBAG_free);
        ^
390.   	sk_push (safes, (char *)authsafe);
391.   

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

apps/pkcs12.c:390:2: Call
388.   	authsafe = PKCS12_pack_p7data (bags);
389.   	sk_pop_free(bags, PKCS12_SAFEBAG_free);
390.   	sk_push (safes, (char *)authsafe);
        ^
391.   
392.   	p12 = PKCS12_init (NID_pkcs7_data);

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

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

crypto/stack/stack.c:139:1: Parameter `*st->data`
    137.   	}
    138.   
    139. > int sk_insert(STACK *st, char *data, int loc)
    140.   	{
    141.   	char **s;

apps/pkcs12.c:394:2: Call
392.   	p12 = PKCS12_init (NID_pkcs7_data);
393.   
394.   	M_PKCS12_pack_authsafes (p12, safes);
        ^
395.   
396.   	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:88:1: <Offset trace>
86.   
87.   /* int is_set:  if TRUE, then sort the contents (i.e. it isn't a SEQUENCE)    */
88. > int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(), int ex_tag,
89.   	     int ex_class, int is_set)
90.   	{

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

crypto/asn1/a_set.c:99:7: Assignment
    97.   
    98.   	if (a == NULL) return(0);
    99.   	for (i=sk_num(a)-1; i>=0; i--)
                 ^
    100.   		ret+=func(sk_value(a,i),NULL);
    101.   	r=ASN1_object_size(1,ret,ex_tag);

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

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

crypto/asn1/a_set.c:100:13: Array access: Offset: [0, 1] Size: [0, +oo] by call to `ASN1_seq_pack` 
    98.   	if (a == NULL) return(0);
    99.   	for (i=sk_num(a)-1; i>=0; i--)
    100.   		ret+=func(sk_value(a,i),NULL);
                       ^
    101.   	r=ASN1_object_size(1,ret,ex_tag);
    102.   	if (pp == NULL) return(r);
