summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2020-10-29 02:10:07 -0500
committerA. Wilcox <awilcox@wilcox-tech.com>2022-06-26 21:06:02 +0000
commitc6921a1aa454bb87671f9bd1ecfe47d80d1620aa (patch)
tree3c82eef28f0887d979c9e4ab02eb057130f1a0f3
parentb15e0349412b79f77b723372c0012caf9daa8f1a (diff)
downloadgcompat-c6921a1aa454bb87671f9bd1ecfe47d80d1620aa.tar.gz
gcompat-c6921a1aa454bb87671f9bd1ecfe47d80d1620aa.tar.bz2
gcompat-c6921a1aa454bb87671f9bd1ecfe47d80d1620aa.tar.xz
gcompat-c6921a1aa454bb87671f9bd1ecfe47d80d1620aa.zip
string: add __explicit_bzero_chk
-rw-r--r--CHANGELOG.rst1
-rw-r--r--libgcompat/string.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 8b2596e..ce6859b 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -21,6 +21,7 @@ string
* Add historical, non-POSIX strerror_r definition.
+* Add __explicit_bzero_chk
1.0.0 (2020-09-27)
==================
diff --git a/libgcompat/string.c b/libgcompat/string.c
index f2a2e87..a164ab2 100644
--- a/libgcompat/string.c
+++ b/libgcompat/string.c
@@ -87,6 +87,14 @@ void *__memset_chk(void *s, int c, size_t n, size_t buflen)
return memset(s, c, n);
}
+void __explicit_bzero_chk(void *s, size_t n, size_t buflen)
+{
+ assert(s != NULL);
+ assert(buflen >= n);
+
+ explicit_bzero(s, n);
+}
+
/**
* Find byte in memory.
*