From 01ce4a5296a26fdf6eea24f7140b51e5c5224602 Mon Sep 17 00:00:00 2001 From: "R.E. Wolff" Date: Sat, 3 Apr 2021 10:25:41 +0200 Subject: [PATCH] Slight cleanup, but no fix for code that came up in a bugreport. --- SECURITY | 2 +- TODO | 2 ++ ui/asn.c | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/SECURITY b/SECURITY index 82c697c..3dae7e5 100644 --- a/SECURITY +++ b/SECURITY @@ -35,7 +35,7 @@ minimal. 3. Make mtr-packet a setuid-root binary. The mtr-packet binary can be made setuid-root, which is what "make install" -does by default. +does only if using setcap (above) fails. Using setcap is tried first. When mtr-packet is installed as suid-root, some concern over security is justified. mtr-packet does the following two things after it is launched: diff --git a/TODO b/TODO index ed8950f..99720c8 100644 --- a/TODO +++ b/TODO @@ -23,6 +23,8 @@ Oh, Feel free to provide suggestions for this list. ---------------------------------------------------------------------- +- cleanup + - cleanup warnings that the newer GCC produces. - Stuff to implement: diff --git a/ui/asn.c b/ui/asn.c index 2310a1b..4790d6a 100644 --- a/ui/asn.c +++ b/ui/asn.c @@ -207,11 +207,11 @@ static void reverse_host6( { int i; char *b = buff; - for (i = (sizeof(*addr) / 2 - 1); i >= 0; i--, b += 4) /* 64b portion */ + // We need to process the top 64 bits, or 8 bytes. + for (i = 8-1; i >= 0; i--, b += 4, buff_length -= 4) snprintf(b, buff_length, "%x.%x.", addr->s6_addr[i] & 0xf, addr->s6_addr[i] >> 4); - - buff[strlen(buff) - 1] = '\0'; + *--b = 0; } #endif -- 2.47.2