Skip to content

Commit

Permalink
compat/arc4random.c: use memset instead of explicit_bzero (#252)
Browse files Browse the repository at this point in the history
Use memset instead of explicit_bzero to avoid the following build
failure with uclibc-ng since version 10.0.3 and
837d09e:

/home/fabrice/buildroot/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabi/12.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: ../compat/arc4random.o: in function `_rs_stir_if_needed':
arc4random.c:(.text+0x8cc): undefined reference to `explicit_bzero'

Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine authored Oct 16, 2023
1 parent 52f1b73 commit 5707073
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compat/arc4random.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ _rs_stir(void)
_rs_init(rnd, sizeof(rnd));
else
_rs_rekey(rnd, sizeof(rnd));
explicit_bzero(rnd, sizeof(rnd)); /* discard source seed */
memset(rnd, 0, sizeof(rnd)); /* discard source seed */

/* invalidate rs_buf */
rs->rs_have = 0;
Expand Down

0 comments on commit 5707073

Please sign in to comment.