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 <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#13528
Closes openzfs#13575
  • Loading branch information
behlendorf authored and andrewc12 committed Sep 23, 2022
1 parent 75bb3cc commit 8394679
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/icp/algs/edonr/edonr.c
Expand Up @@ -491,7 +491,7 @@ EdonRInit(EdonRState *state, size_t hashbitlen)
state->hashbitlen = 512;
state->bits_processed = 0;
state->unprocessed_bits = 0;
memcpy(hashState224(state)->DoublePipe, i512p2,
memcpy(hashState512(state)->DoublePipe, i512p2,
sizeof (i512p2));
break;
}
Expand Down

0 comments on commit 8394679

Please sign in to comment.