[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/main] Fix compiler warnings from ubuntu/jammy



commit bf10206e9e23ac0ded2cc9727666696ea25d5636
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
Date:   Wed Dec 15 09:00:15 2021 -0500

    Fix compiler warnings from ubuntu/jammy
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxxxxxxx>
---
 changes/ticket40516                 | 3 +++
 src/feature/dirparse/policy_parse.c | 4 ++++
 src/feature/relay/selftest.c        | 4 ++++
 3 files changed, 11 insertions(+)

diff --git a/changes/ticket40516 b/changes/ticket40516
new file mode 100644
index 0000000000..fb84bb4b14
--- /dev/null
+++ b/changes/ticket40516
@@ -0,0 +1,3 @@
+  o Minor bugfixes (compiler warnings):
+    - Fix couple compiler warnings on latest Ubuntu Jammy. Fixes bug 40516;
+      bugfix on 0.3.5.1-alpha.
diff --git a/src/feature/dirparse/policy_parse.c b/src/feature/dirparse/policy_parse.c
index abf3df36c6..8d30410f58 100644
--- a/src/feature/dirparse/policy_parse.c
+++ b/src/feature/dirparse/policy_parse.c
@@ -192,6 +192,10 @@ router_parse_addr_policy_private(directory_token_t *tok)
   uint16_t port_min, port_max;
   addr_policy_t result;
 
+  /* Safeguard: always flag non canonical because it is a stack allocated
+   * object and thus should not be considered a copy stored in a map. */
+  result.is_canonical = 0;
+
   arg = tok->args[0];
   if (strcmpstart(arg, "private"))
     return NULL;
diff --git a/src/feature/relay/selftest.c b/src/feature/relay/selftest.c
index 8922d20a19..a791079bd8 100644
--- a/src/feature/relay/selftest.c
+++ b/src/feature/relay/selftest.c
@@ -254,6 +254,10 @@ router_do_orport_reachability_checks(const routerinfo_t *me,
   if (ei) {
     const char *family_name = fmt_af_family(family);
     const tor_addr_port_t *ap = extend_info_get_orport(ei, family);
+    if (BUG(!ap)) {
+      /* Not much we can do here to recover apart from screaming loudly. */
+      return;
+    }
     log_info(LD_CIRC, "Testing %s of my %s ORPort: %s.",
              !orport_reachable ? "reachability" : "bandwidth",
              family_name, fmt_addrport_ap(ap));



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits