diff options
author | Michael Brown | 2015-04-24 15:34:32 +0200 |
---|---|---|
committer | Michael Brown | 2015-04-24 15:41:32 +0200 |
commit | 9aa8090d069eb0b36769f33544faf0e7e429e844 (patch) | |
tree | 02dd0bdc5afca6e625f2f6c73fd85244ab020093 /src/net/pccrc.c | |
parent | [test] Include IPv6 support when performing settings self-tests (diff) | |
download | ipxe-9aa8090d069eb0b36769f33544faf0e7e429e844.tar.gz ipxe-9aa8090d069eb0b36769f33544faf0e7e429e844.tar.xz ipxe-9aa8090d069eb0b36769f33544faf0e7e429e844.zip |
[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/pccrc.c')
-rw-r--r-- | src/net/pccrc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/pccrc.c b/src/net/pccrc.c index 10342207..6ea26b3d 100644 --- a/src/net/pccrc.c +++ b/src/net/pccrc.c @@ -63,7 +63,7 @@ peerdist_info_hash_ntoa ( const struct peerdist_info *info, const void *hash ) { assert ( base16_encoded_len ( digestsize ) < sizeof ( buf ) ); /* Transcribe hash value */ - base16_encode ( hash, digestsize, buf ); + base16_encode ( hash, digestsize, buf, sizeof ( buf ) ); return buf; } |