Skip to content

Commit

Permalink
Fix -Wattribute-warning in edonr
Browse files Browse the repository at this point in the history
The wrong union memory was being accessed in EdonRInit resulting in
a write beyond size of field compiler warning.  Reference the correct
member to resolve the warning.  The warning was correct and this in
case the mistake was harmless.

    In function ‘fortify_memcpy_chk’,
    inlined from ‘EdonRInit’ at zfs/module/icp/algs/edonr/edonr.c:494:3:
    ./include/linux/fortify-string.h:344:25: error: call to
    ‘__write_overflow_field’ declared with attribute warning:
    detected write beyond size of field (1st parameter);
    maybe use struct_group()? [-Werror=attribute-warning]

Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#13528
Closes openzfs#13575
  • Loading branch information
behlendorf committed Jul 22, 2022
1 parent d880ad5 commit 35da31e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/icp/algs/edonr/edonr.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ EdonRInit(EdonRState *state, size_t hashbitlen)
state->hashbitlen = 512;
state->bits_processed = 0;
state->unprocessed_bits = 0;
bcopy(i512p2, hashState224(state)->DoublePipe,
bcopy(i512p2, hashState512(state)->DoublePipe,
16 * sizeof (uint64_t));
break;
}
Expand Down

0 comments on commit 35da31e

Please sign in to comment.