help-libtasn1
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] Make _asn1_ordering_set_of() really sort.


From: Kurt Roeckx
Subject: Re: [PATCH 1/3] Make _asn1_ordering_set_of() really sort.
Date: Sat, 26 Apr 2014 23:19:40 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

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

[Prev in Thread] Current Thread [Next in Thread]