aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypt_ops
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-18 14:43:57 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-18 14:43:57 -0400
commit7ace8d5a61f75fb77e3619deed417edd5610a4f1 (patch)
tree10eaf79b0eb6e568491afc7ea5c7c35fa6a633c6 /src/lib/crypt_ops
parent620108ea7770608de72dcbea4ca73d6fb99c1109 (diff)
downloadtor-7ace8d5a61f75fb77e3619deed417edd5610a4f1.tar.gz
tor-7ace8d5a61f75fb77e3619deed417edd5610a4f1.zip
Assert that some trunnel _new() functions return non-NULL
The trunnel functions are written under the assumption that their allocators can fail, so GCC LTO thinks they might return NULL. In point of fact, they're using tor_malloc() and friends, which can't fail, but GCC won't necessarily figure that out. Fixes part of #27772.
Diffstat (limited to 'src/lib/crypt_ops')
-rw-r--r--src/lib/crypt_ops/crypto_pwbox.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/crypt_ops/crypto_pwbox.c b/src/lib/crypt_ops/crypto_pwbox.c
index 2377f216a0..91536e891b 100644
--- a/src/lib/crypt_ops/crypto_pwbox.c
+++ b/src/lib/crypt_ops/crypto_pwbox.c
@@ -61,6 +61,7 @@ crypto_pwbox(uint8_t **out, size_t *outlen_out,
int rv;
enc = pwbox_encoded_new();
+ tor_assert(enc);
pwbox_encoded_setlen_skey_header(enc, S2K_MAXLEN);