[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/4] Call ordering functions with the right length
From: |
Kurt Roeckx |
Subject: |
[PATCH 1/4] Call ordering functions with the right length |
Date: |
Sun, 20 Apr 2014 16:50:00 +0200 |
We're going to insert the length of the set and at this point are going to order
it. But we called it with the wrong length. Also updates the check to only do
it when the buffer isn't to small.
---
lib/coding.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/coding.c b/lib/coding.c
index 70cd14f..705f8b1 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -1167,7 +1167,7 @@ asn1_der_coding (asn1_node element, const char *name,
void *ider, int *len,
len2 = _asn1_strtol (p->value, NULL, 10);
_asn1_set_value (p, NULL, 0);
if ((type_field (p->type) == ASN1_ETYPE_SET) && (max_len >= 0))
- _asn1_ordering_set (der + len2, max_len - len2, p);
+ _asn1_ordering_set (der + len2, counter - len2, p);
asn1_length_der (counter - len2, temp, &len3);
max_len -= len3;
if (max_len >= 0)
@@ -1207,7 +1207,7 @@ asn1_der_coding (asn1_node element, const char *name,
void *ider, int *len,
len2 = _asn1_strtol (p->value, NULL, 10);
_asn1_set_value (p, NULL, 0);
if ((type_field (p->type) == ASN1_ETYPE_SET_OF)
- && (max_len - len2 > 0))
+ && (counter - len2 > 0) && (max_len >= 0))
{
_asn1_ordering_set_of (der + len2, max_len - len2, p);
}
--
1.9.1
- [PATCH 1/4] Call ordering functions with the right length,
Kurt Roeckx <=
- [PATCH 4/4] Fix memory leak., Kurt Roeckx, 2014/04/20
- [PATCH 3/4] _asn1_ordering_*(): Fix memory leak in case of error, Kurt Roeckx, 2014/04/20
- [PATCH 2/4] Make _asn1_ordering_* return error values and check them., Kurt Roeckx, 2014/04/20
- Re: [PATCH 2/4] Make _asn1_ordering_* return error values and check them., Nikos Mavrogiannopoulos, 2014/04/21
- Re: [PATCH 2/4] Make _asn1_ordering_* return error values and check them., Kurt Roeckx, 2014/04/24
- Re: [PATCH 2/4] Make _asn1_ordering_* return error values and check them., Nikos Mavrogiannopoulos, 2014/04/25
- Re: [PATCH 2/4] Make _asn1_ordering_* return error values and check them., Kurt Roeckx, 2014/04/24
- Re: [PATCH 2/4] Make _asn1_ordering_* return error values and check them., Kurt Roeckx, 2014/04/24
- Re: [PATCH 2/4] Make _asn1_ordering_* return error values and check them., Kurt Roeckx, 2014/04/25
- Re: [PATCH 2/4] Make _asn1_ordering_* return error values and check them., Nikos Mavrogiannopoulos, 2014/04/26