summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/kdf.c4
-rw-r--r--apps/openssl.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/apps/kdf.c b/apps/kdf.c
index 66e7e7a7c1..82818f1ff3 100644
--- a/apps/kdf.c
+++ b/apps/kdf.c
@@ -138,6 +138,10 @@ opthelp:
BIO_write(out, dkm_bytes, dkm_len);
} else {
hexout = OPENSSL_buf2hexstr(dkm_bytes, dkm_len);
+ if (hexout == NULL) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto err;
+ }
BIO_printf(out, "%s\n\n", hexout);
}
diff --git a/apps/openssl.c b/apps/openssl.c
index 31f598815a..769555e5e1 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -113,7 +113,8 @@ static size_t internal_trace_cb(const char *buf, size_t cnt,
tid = CRYPTO_THREAD_get_current_id();
hex = OPENSSL_buf2hexstr((const unsigned char *)&tid, sizeof(tid));
BIO_snprintf(buffer, sizeof(buffer), "TRACE[%s]:%s: ",
- hex, OSSL_trace_get_category_name(category));
+ hex == NULL ? "<null>" : hex,
+ OSSL_trace_get_category_name(category));
OPENSSL_free(hex);
BIO_ctrl(trace_data->bio, PREFIX_CTRL_SET_PREFIX,
strlen(buffer), buffer);