[tor-commits] [tor/release-0.4.1] Replace some "fall through" comments not at the end of a case.

nickm at torproject.org nickm at torproject.org
Wed May 6 20:50:31 UTC 2020


commit 9fe23b8672fdc4da64a99acf55b47193375b9562
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed May 6 10:35:36 2020 -0400

    Replace some "fall through" comments not at the end of a case.
---
 src/core/proto/proto_socks.c | 5 ++++-
 src/feature/relay/dns.c      | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/core/proto/proto_socks.c b/src/core/proto/proto_socks.c
index 8b78ed44c..a6493366e 100644
--- a/src/core/proto/proto_socks.c
+++ b/src/core/proto/proto_socks.c
@@ -1067,7 +1067,10 @@ parse_socks_client(const uint8_t *data, size_t datalen,
           log_info(LD_NET, "SOCKS 5 client: need authentication.");
           *drain_out = -1;
           return 2;
-        /* fall through */
+        default:
+          /* This wasn't supposed to be exhaustive; there are other
+           * authentication methods too. */
+          ;
       }
 
       *reason = tor_strdup("server doesn't support any of our available "
diff --git a/src/feature/relay/dns.c b/src/feature/relay/dns.c
index cc9f4cf49..38395862c 100644
--- a/src/feature/relay/dns.c
+++ b/src/feature/relay/dns.c
@@ -546,7 +546,7 @@ send_resolved_cell,(edge_connection_t *conn, uint8_t answer_type,
         break;
       } else {
         answer_type = RESOLVED_TYPE_ERROR;
-        /* fall through. */
+        /* We let this fall through and treat it as an error. */
       }
       /* Falls through. */
     case RESOLVED_TYPE_ERROR_TRANSIENT:





More information about the tor-commits mailing list