summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2017-05-02 22:47:12 -0700
committerMichael Forney <mforney@mforney.org>2017-05-02 23:22:02 -0700
commit73c0a90073109b3616bdbfbe6386c7b2d1df469b (patch)
treeba4c3cdf98abb37fd31fd6000a1ee024e5e24fba /pkg
parentfbf3b365dbbabbc26d9c89e71d1a47d6b7d34f4d (diff)
openbsd: Use provided recallocarray instead of patching with explicit_bzero
When I originally looked at this, I only saw the malloc-internal implementation, but it looks like they have left the original standalone recallocarray.c implementation.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/openbsd/gen.rc2
-rw-r--r--pkg/openbsd/include/stdlib.h1
-rw-r--r--pkg/openbsd/patch/0018-Use-explicit_bzero-reallocarray-instead-of-recalloca.patch42
-rw-r--r--pkg/openbsd/rev2
4 files changed, 3 insertions, 44 deletions
diff --git a/pkg/openbsd/gen.rc b/pkg/openbsd/gen.rc
index d8d1caf9..315f329c 100644
--- a/pkg/openbsd/gen.rc
+++ b/pkg/openbsd/gen.rc
@@ -16,7 +16,7 @@ lib libbsd.a -d pkg/libressl/headers\
lib/libc/^(\
crypt/^(arc4random.c.o arc4random_uniform.c)\
gen/^(fts.c getprogname.c pwcache.c readpassphrase.c setprogname.c vis.c warnc.c vwarnc.c)\
- stdlib/^(reallocarray.c strtonum.c)\
+ stdlib/^(reallocarray.c recallocarray.c strtonum.c)\
string/^(explicit_bzero.c strmode.c timingsafe_memcmp.c)\
)\
lib/libcrypto/arc4random/getentropy_linux.c
diff --git a/pkg/openbsd/include/stdlib.h b/pkg/openbsd/include/stdlib.h
index 0e1aa252..6a07cadf 100644
--- a/pkg/openbsd/include/stdlib.h
+++ b/pkg/openbsd/include/stdlib.h
@@ -1,6 +1,7 @@
#include_next <stdlib.h>
#include <stdint.h>
void *reallocarray(void *, size_t, size_t);
+void *recallocarray(void *, size_t, size_t, size_t);
long long strtonum(const char *, long long, long long, const char **);
uint32_t arc4random(void);
uint32_t arc4random_uniform(uint32_t);
diff --git a/pkg/openbsd/patch/0018-Use-explicit_bzero-reallocarray-instead-of-recalloca.patch b/pkg/openbsd/patch/0018-Use-explicit_bzero-reallocarray-instead-of-recalloca.patch
deleted file mode 100644
index 9c8b684a..00000000
--- a/pkg/openbsd/patch/0018-Use-explicit_bzero-reallocarray-instead-of-recalloca.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From fcc6087729cc9b0514008876780782e2d1e5afbd Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Fri, 14 Apr 2017 11:56:51 -0700
-Subject: [PATCH] Use explicit_bzero + reallocarray instead of recallocarray
-
----
- lib/libc/gen/fts.c | 4 ++--
- usr.bin/patch/pch.c | 3 ++-
- 2 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
-index f41254c71..6f10c534f 100644
---- a/lib/libc/gen/fts.c
-+++ b/lib/libc/gen/fts.c
-@@ -967,8 +967,8 @@ fts_palloc(FTS *sp, size_t more)
- errno = ENAMETOOLONG;
- return (1);
- }
-- p = recallocarray(sp->fts_path, sp->fts_pathlen,
-- sp->fts_pathlen + more, 1);
-+ explicit_bzero(sp->fts_path, sp->fts_pathlen);
-+ p = realloc(sp->fts_path, sp->fts_pathlen + more);
- if (p == NULL) {
- free(sp->fts_path);
- sp->fts_path = NULL;
-diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c
-index 251dd7c58..5c69ba281 100644
---- a/usr.bin/patch/pch.c
-+++ b/usr.bin/patch/pch.c
-@@ -157,7 +157,8 @@ grow_hunkmax(void)
- if (new_p_len == NULL)
- free(p_len);
-
-- new_p_char = recallocarray(p_char, hunkmax, new_hunkmax, sizeof(char));
-+ explicit_bzero(p_char, hunkmax);
-+ new_p_char = reallocarray(p_char, new_hunkmax, sizeof(char));
- if (new_p_char == NULL)
- free(p_char);
-
---
-2.12.2
-
diff --git a/pkg/openbsd/rev b/pkg/openbsd/rev
index 48082f72..b1bd38b6 100644
--- a/pkg/openbsd/rev
+++ b/pkg/openbsd/rev
@@ -1 +1 @@
-12
+13