Skip to content

Commit

Permalink
Pass in outlen correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Dec 3, 2017
1 parent ce33afd commit bb517b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/rlm_eap/lib/sim/encode.c
Expand Up @@ -729,9 +729,9 @@ static ssize_t encode_rfc_hdr(uint8_t *out, size_t outlen, fr_dict_attr_t const

p += 2; /* Leave space for attr + len */
if (da->flags.array) {
slen = encode_array(p, end - p, tlv_stack, depth, cursor, encoder_ctx);
slen = encode_array(p, outlen - (p - out), tlv_stack, depth, cursor, encoder_ctx);
} else {
slen = encode_value(p, end - p, tlv_stack, depth, cursor, encoder_ctx);
slen = encode_value(p, outlen - (p - out), tlv_stack, depth, cursor, encoder_ctx);
}
if (slen <= 0) return slen;
p += slen;
Expand Down

0 comments on commit bb517b4

Please sign in to comment.