summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-05-30 20:10:00 +0000
committerderaadt <deraadt@openbsd.org>2014-05-30 20:10:00 +0000
commit3b5ced0b82fc4ed1b3cb8f0ca68370858679c226 (patch)
treed988fc4fb6d6e67fb493d1cb2b11f19770dbd1b1
parentRemove dead assignment and newly created unused variable. (diff)
downloadwireguard-openbsd-3b5ced0b82fc4ed1b3cb8f0ca68370858679c226.tar.xz
wireguard-openbsd-3b5ced0b82fc4ed1b3cb8f0ca68370858679c226.zip
Don't add potentially nasty stderr uses to dead CRYPTO_dbg_mem functions.
But do use the abort(), which we are hoping all future vendors will move towards the more modern "do not flush streams"; hint hint, if you didn't do that already, there are grave risks because much software brings risk without that behaviour. We didn't cause the change.. POSIX did... ok beck
-rw-r--r--lib/libcrypto/mem_dbg.c6
-rw-r--r--lib/libssl/src/crypto/mem_dbg.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/libcrypto/mem_dbg.c b/lib/libcrypto/mem_dbg.c
index 288ee907c34..3e56c79a25a 100644
--- a/lib/libcrypto/mem_dbg.c
+++ b/lib/libcrypto/mem_dbg.c
@@ -162,14 +162,14 @@ void
CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line,
int before_p)
{
- fprintf(stderr, "this is a bad idea");
+ /* CRYPTO_dbg_malloc is no longer permitted */
abort();
}
void
CRYPTO_dbg_free(void *addr, int before_p)
{
- fprintf(stderr, "this is a bad idea");
+ /* CRYPTO_dbg_free is no longer permitted */
abort();
}
@@ -177,7 +177,7 @@ void
CRYPTO_dbg_realloc(void *addr1, void *addr2, int num,
const char *file, int line, int before_p)
{
- fprintf(stderr, "this is a bad idea");
+ /* CRYPTO_dbg_realloc is no longer permitted */
abort();
}
diff --git a/lib/libssl/src/crypto/mem_dbg.c b/lib/libssl/src/crypto/mem_dbg.c
index 288ee907c34..3e56c79a25a 100644
--- a/lib/libssl/src/crypto/mem_dbg.c
+++ b/lib/libssl/src/crypto/mem_dbg.c
@@ -162,14 +162,14 @@ void
CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line,
int before_p)
{
- fprintf(stderr, "this is a bad idea");
+ /* CRYPTO_dbg_malloc is no longer permitted */
abort();
}
void
CRYPTO_dbg_free(void *addr, int before_p)
{
- fprintf(stderr, "this is a bad idea");
+ /* CRYPTO_dbg_free is no longer permitted */
abort();
}
@@ -177,7 +177,7 @@ void
CRYPTO_dbg_realloc(void *addr1, void *addr2, int num,
const char *file, int line, int before_p)
{
- fprintf(stderr, "this is a bad idea");
+ /* CRYPTO_dbg_realloc is no longer permitted */
abort();
}