On Sat, Apr 26, 2014 at 06:10:30PM +0200, Kurt Roeckx wrote:
> @@ -915,62 +916,71 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, 
> asn1_node node)
>    while (p_vet)
>      {
>        p2_vet = p_vet->next;
> -      counter = 0;
>        while (p2_vet)
>       {
> -       if ((p_vet->end - counter) > (p2_vet->end - p_vet->end))
> -         max = p_vet->end - counter;
> +       len = p_vet->end - p_vet->start;
> +       len2 = p2_vet->end - p2_vet->start;
> +       if (len > len2)
> +         max = len;
>         else
> -         max = p2_vet->end - p_vet->end;
> +         max = len2;


This seems to be wrong in the old code, and I just copied the bug.
You want the minimum of the 2 lengths and either want to change
the > to <, or change the branches of the else.


Kurt


Reply via email to