Closed
Conversation
Signed-off-by: ethan-thompson <ethan.thompson@networkradius.com>
Signed-off-by: ethan-thompson <ethan.thompson@networkradius.com>
arr2036
reviewed
Mar 20, 2026
| } | ||
|
|
||
| return memcmp(a->data, b->data, b->len); | ||
| size_t min_len = (a->len < b->len) ? a->len : b->len; |
Member
There was a problem hiding this comment.
Uh, yeah. Just pass it directly to memcmp
arr2036
reviewed
Mar 20, 2026
| more = ((uint8_t) (i > 0)) << 7; | ||
|
|
||
| FR_DBUFF_IN_RETURN(&our_dbuff, (uint8_t) (more | part)); | ||
| wrote = true; |
Member
There was a problem hiding this comment.
More explanation about why this is an issue?
Member
There was a problem hiding this comment.
The previous code skipped 0x00 in the middle of a number :(
Member
|
There's a MEMCMP_FIELDS macro which takes care of memcmp and different length fieldsSent from my iPhoneOn Mar 20, 2026, at 5:46 PM, Arran Cudbard-Bell ***@***.***> wrote:
@arr2036 commented on this pull request.
In src/protocols/der/encode.c:
@@ -751,11 +751,8 @@ static int CC_HINT(nonnull) fr_der_encode_set_of_cmp(void const *one, void const
fr_der_encode_set_of_ptr_pairs_t const *a = one;
fr_der_encode_set_of_ptr_pairs_t const *b = two;
- if (a->len >= b->len) {
- return memcmp(a->data, b->data, a->len);
- }
-
- return memcmp(a->data, b->data, b->len);
+ size_t min_len = (a->len < b->len) ? a->len : b->len;
Uh, yeah. Just pass it directly to memcmp
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Member
|
much better :)
|
Member
|
merged, thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few bugs found in the DER protocol code