mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Use tor_assertf{_nonfatal} in code
This commit is contained in:
parent
f66a17444e
commit
a959d7cb98
@ -3117,7 +3117,9 @@ circuit_sent_valid_data(origin_circuit_t *circ, uint16_t relay_body_len)
|
||||
{
|
||||
if (!circ) return;
|
||||
|
||||
tor_assert_nonfatal(relay_body_len <= RELAY_PAYLOAD_SIZE);
|
||||
tor_assertf_nonfatal(relay_body_len <= RELAY_PAYLOAD_SIZE,
|
||||
"Wrong relay_body_len: %d (should be at most %d)",
|
||||
relay_body_len, RELAY_PAYLOAD_SIZE);
|
||||
|
||||
circ->n_delivered_written_circ_bw =
|
||||
tor_add_u32_nowrap(circ->n_delivered_written_circ_bw, relay_body_len);
|
||||
|
@ -46,7 +46,7 @@ crash(int x)
|
||||
*(volatile int *)0 = 0;
|
||||
#endif /* defined(__clang_analyzer__) || defined(__COVERITY__) */
|
||||
} else if (crashtype == 1) {
|
||||
tor_assert(1 == 0);
|
||||
tor_assertf(1 == 0, "%d != %d", 1, 0);
|
||||
} else if (crashtype == -1) {
|
||||
;
|
||||
}
|
||||
|
@ -448,7 +448,8 @@ static int next_key_idx_2048;
|
||||
static crypto_pk_t *
|
||||
pk_generate_internal(int bits)
|
||||
{
|
||||
tor_assert(bits == 2048 || bits == 1024);
|
||||
tor_assertf(bits == 2048 || bits == 1024,
|
||||
"Wrong key size: %d", bits);
|
||||
|
||||
#ifdef USE_PREGENERATED_RSA_KEYS
|
||||
int *idxp;
|
||||
|
Loading…
Reference in New Issue
Block a user