From: Fabrice Fontaine Date: Mon, 16 Oct 2023 17:03:41 +0000 (+0200) Subject: compat/arc4random.c: use memset instead of explicit_bzero (#252) X-Git-Tag: v10.0.4~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57070736a5d00c809e6a3777ab56745ef3e5bf0f;p=thirdparty%2Fdhcpcd.git compat/arc4random.c: use memset instead of explicit_bzero (#252) Use memset instead of explicit_bzero to avoid the following build failure with uclibc-ng since version 10.0.3 and https://github.com/NetworkConfiguration/dhcpcd/commit/837d09e34c487edaa92aa2ae71a630d84c927f8e: /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 --- diff --git a/compat/arc4random.c b/compat/arc4random.c index 8f28f616..fdf60527 100644 --- a/compat/arc4random.c +++ b/compat/arc4random.c @@ -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;