]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
compat/arc4random.c: use memset instead of explicit_bzero (#252)
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Mon, 16 Oct 2023 17:03:41 +0000 (19:03 +0200)
committerGitHub <noreply@github.com>
Mon, 16 Oct 2023 17:03:41 +0000 (18:03 +0100)
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 <fontaine.fabrice@gmail.com>
compat/arc4random.c

index 8f28f616d2fec9d7d36fca161a11dc5382bc2b7d..fdf605274caac05c3bf0ee3b3e22ec08d74e9fb3 100644 (file)
@@ -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;