Skip to content

Commit 3a7997a

Browse files
authored
hmac.c: fix mismatching function prototype (#537)
The reported function raises a warning when compilers assert the flag `-Warray-parameter=`, signaling that an array-type argument was promoted to a pointer-type argument. While in practice in most C implementations this is correct, fixing the warning (and, in this case, indicating the maximum size for the array) would represent a best-practice for finding out-of-bound accesses or identifying wrongly-sized arrays passed in the function. Signed-off-by: Francesco Giancane <[email protected]>
1 parent ff06a49 commit 3a7997a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ int hmacFinalBits(HMACContext *ctx,
208208
* sha Error Code.
209209
*
210210
*/
211-
int hmacResult(HMACContext *ctx, uint8_t *digest)
211+
int hmacResult(HMACContext *ctx, uint8_t digest[USHAMaxHashSize])
212212
{
213213
if (!ctx) return shaNull;
214214

0 commit comments

Comments
 (0)