Skip to content

Commit 47c30d7

Browse files
ethan-thompsonalandekok
authored andcommitted
avoid buffer overread in SET OF lexicographic comparator
Signed-off-by: ethan-thompson <ethan.thompson@networkradius.com>
1 parent fbedd50 commit 47c30d7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/protocols/der/encode.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -751,11 +751,7 @@ static int CC_HINT(nonnull) fr_der_encode_set_of_cmp(void const *one, void const
751751
fr_der_encode_set_of_ptr_pairs_t const *a = one;
752752
fr_der_encode_set_of_ptr_pairs_t const *b = two;
753753

754-
if (a->len >= b->len) {
755-
return memcmp(a->data, b->data, a->len);
756-
}
757-
758-
return memcmp(a->data, b->data, b->len);
754+
return MEMCMP_FIELDS(a, b, data, len);
759755
}
760756

761757
static ssize_t fr_der_encode_set(fr_dbuff_t *dbuff, fr_dcursor_t *cursor, fr_der_encode_ctx_t *encode_ctx)

0 commit comments

Comments
 (0)