Skip to content

Commit

Permalink
libc: add __explicit_bzero_chk()
Browse files Browse the repository at this point in the history
Needed by newer version ruby.

Signed-off-by: KANATSU Minoru <icc.po...@gmail.com>
Message-Id: <20190528135740.32121-1-icc.pot.tyew272@gmail.com>
  • Loading branch information
KANATSU Minoru authored and wkozaczuk committed Jun 5, 2019
1 parent c1b8059 commit 982acdb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@ libc += stdlib/strtod.o
libc += stdlib/wcstol.o

libc += string/__memcpy_chk.o
libc += string/__explicit_bzero_chk.o
musl += string/bcmp.o
musl += string/bcopy.o
musl += string/bzero.o
Expand Down
11 changes: 11 additions & 0 deletions libc/string/__explicit_bzero_chk.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <string.h>
#include <stdlib.h>

void __explicit_bzero_chk(void *dest, size_t len, size_t destlen)
{
if (len > destlen) {
abort();
}
memset(dest, 0, len);
return;
}

0 comments on commit 982acdb

Please sign in to comment.