[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
- [PATCH 2/3] Make asn1_ordering_set_of() return error if it can't find data for one of the entries., (continued)
- [PATCH 2/3] Make asn1_ordering_set_of() return error if it can't find data for one of the entries., Kurt Roeckx, 2014/04/26
- [PATCH 3/3] Check that p is not NULL, Kurt Roeckx, 2014/04/26
- Re: [PATCH 1/3] Make _asn1_ordering_set_of() really sort., Kurt Roeckx, 2014/04/26
- Re: [PATCH 1/3] Make _asn1_ordering_set_of() really sort., Kurt Roeckx, 2014/04/26
- Re: [PATCH 1/3] Make _asn1_ordering_set_of() really sort., Nikos Mavrogiannopoulos, 2014/04/27
- Re: [PATCH 1/3] Make _asn1_ordering_set_of() really sort., Kurt Roeckx, 2014/04/27
- Re: [PATCH 1/3] Make _asn1_ordering_set_of() really sort., Nikos Mavrogiannopoulos, 2014/04/27
- Re: [PATCH 1/3] Make _asn1_ordering_set_of() really sort., Kurt Roeckx, 2014/04/27
- Re: [PATCH 1/3] Make _asn1_ordering_set_of() really sort., Nikos Mavrogiannopoulos, 2014/04/27
- Re: [PATCH 1/3] Make _asn1_ordering_set_of() really sort., Kurt Roeckx, 2014/04/27
Re: [PATCH 1/3] Make _asn1_ordering_set_of() really sort.,
Kurt Roeckx <=