mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
Fix the parameter type of gf_serialize
It is better to use array bounds for improved gcc warning checks. While "uint8_t*" allows arbitrary pointer arithmetic using "uint8_t[SER_BYTES]" limits the pointer arithmetic to the range 0..SER_BYTES. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16376)
This commit is contained in:
parent
9e51f87793
commit
a7f58bdc1a
@ -18,7 +18,7 @@ static const gf MODULUS = {
|
||||
};
|
||||
|
||||
/* Serialize to wire format. */
|
||||
void gf_serialize(uint8_t *serial, const gf x, int with_hibit)
|
||||
void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_hibit)
|
||||
{
|
||||
unsigned int j = 0, fill = 0;
|
||||
dword_t buffer = 0;
|
||||
|
@ -62,7 +62,7 @@ mask_t gf_eq(const gf x, const gf y);
|
||||
mask_t gf_lobit(const gf x);
|
||||
mask_t gf_hibit(const gf x);
|
||||
|
||||
void gf_serialize(uint8_t *serial, const gf x, int with_highbit);
|
||||
void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_highbit);
|
||||
mask_t gf_deserialize(gf x, const uint8_t serial[SER_BYTES], int with_hibit,
|
||||
uint8_t hi_nmask);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user