diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-04-24 14:34:32 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-04-24 14:41:32 +0100 |
commit | 9aa8090d069eb0b36769f33544faf0e7e429e844 (patch) | |
tree | 02dd0bdc5afca6e625f2f6c73fd85244ab020093 /src/net/infiniband | |
parent | b56b482fa3b48ae99c44cc60a34979f8780b076a (diff) | |
download | ipxe-9aa8090d069eb0b36769f33544faf0e7e429e844.tar.gz |
[base16] Add buffer size parameter to base16_encode() and base16_decode()
The current API for Base16 (and Base64) encoding requires the caller
to always provide sufficient buffer space. This prevents the use of
the generic encoding/decoding functionality in some situations, such
as in formatting the hex setting types.
Implement a generic hex_encode() (based on the existing
format_hex_setting()), implement base16_encode() and base16_decode()
in terms of the more generic hex_encode() and hex_decode(), and update
all callers to provide the additional buffer length parameter.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/infiniband')
-rw-r--r-- | src/net/infiniband/ib_srp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/infiniband/ib_srp.c b/src/net/infiniband/ib_srp.c index 7b2b2b4ea..3700184c0 100644 --- a/src/net/infiniband/ib_srp.c +++ b/src/net/infiniband/ib_srp.c @@ -291,7 +291,7 @@ static int ib_srp_parse_byte_string ( const char *rp_comp, uint8_t *bytes, return -EINVAL_BYTE_STRING_LEN; /* Parse byte string */ - decoded_size = base16_decode ( rp_comp, bytes ); + decoded_size = base16_decode ( rp_comp, bytes, size ); if ( decoded_size < 0 ) return decoded_size; |