From d7e166bd95411d3f5caa573e0293356bff78c481 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 30 Apr 2020 22:56:31 -0400 Subject: [PATCH 1/2] Fix a GCC 10.0.1 compilation warning. Fixes 34077 for 0.4.1; bugfix on 0.4.0.3-alpha. (Specifically, GCC first gives this warning for 9eeff921ae7b786d960ea4286d5bba56) --- changes/bug34077 | 3 +++ src/feature/dirauth/shared_random_state.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changes/bug34077 diff --git a/changes/bug34077 b/changes/bug34077 new file mode 100644 index 0000000000..29458bd9de --- /dev/null +++ b/changes/bug34077 @@ -0,0 +1,3 @@ + o Minor bugfixes (compiler warnings): + - Fix compilation warnings with GCC 10.0.1. Fixes bug 34077; bugfix on + 0.4.0.3-alpha. diff --git a/src/feature/dirauth/shared_random_state.c b/src/feature/dirauth/shared_random_state.c index b669e3836e..58c203e204 100644 --- a/src/feature/dirauth/shared_random_state.c +++ b/src/feature/dirauth/shared_random_state.c @@ -1057,8 +1057,9 @@ sr_state_set_valid_after(time_t valid_after) sr_phase_t sr_state_get_phase(void) { - void *ptr; + void *ptr=NULL; state_query(SR_STATE_ACTION_GET, SR_STATE_OBJ_PHASE, NULL, &ptr); + tor_assert(ptr); return *(sr_phase_t *) ptr; } From b1c383e3e65ec539ebe4394652429f1954e3d805 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 30 Apr 2020 23:04:56 -0400 Subject: [PATCH 2/2] Fix a GCC 10.0.1 compilation error. Do not try to stuff "HS_DESC_DECODE_GENERIC_ERROR" (-1) into a socks5_reply_status_t (enum). It doesn't actually make sense, and isn't one of our documented extensions. (This can only happen on a nonfatal assertion that we haven't seen, so it probably isn't happening in practice.) Fixes another case of bug 34077; bugfix on 0.4.3.1-alpha. --- src/feature/hs/hs_client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c index da1202b642..68d6619cea 100644 --- a/src/feature/hs/hs_client.c +++ b/src/feature/hs/hs_client.c @@ -1350,7 +1350,7 @@ client_desc_missing_bad_client_auth(const smartlist_t *entry_conns, /* We should not be called with another type of status. Recover by * sending a generic error. */ tor_assert_nonfatal_unreached(); - code = HS_DESC_DECODE_GENERIC_ERROR; + code = SOCKS5_GENERAL_ERROR; } entry_conn->socks_request->socks_extended_error_code = code; connection_mark_unattached_ap(entry_conn, END_STREAM_REASON_MISC); @@ -2493,4 +2493,3 @@ set_hs_client_auths_map(digest256map_t *map) } #endif /* defined(TOR_UNIT_TESTS) */ -