]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix Matthews code to actually use tmp
authorFrancisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
Tue, 23 Dec 2014 17:55:48 +0000 (12:55 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 23 Dec 2014 17:55:48 +0000 (12:55 -0500)
Matthew's autoaddr code returned an undecorated address when trying to check
that the code didn't insert an undecorated one into the map.

This patch fixes this by actually storing the undecorated address in tmp
instead of buf as it was originally intended.

This patch is released under the same license as the original file as
long as the author iscredited.

Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
src/or/addressmap.c

index 998770a3db2d3d3d66b355a19efe241487648b4b..9062d76eedccf00b802a7d6977640dc26d7c24bf 100644 (file)
@@ -888,7 +888,7 @@ addressmap_get_virtual_address(int type)
         /* XXXX This code is to make sure I didn't add an undecorated version
          * by mistake. I hope it's needless. */
         char tmp[TOR_ADDR_BUF_LEN];
-        tor_addr_to_str(buf, &addr, sizeof(tmp), 0);
+        tor_addr_to_str(tmp, &addr, sizeof(tmp), 0);
         if (strmap_get(addressmap, tmp)) {
           log_warn(LD_BUG, "%s wasn't in the addressmap, but %s was.",
                    buf, tmp);