]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a log-uninitialized-buffer bug.
authorNick Mathewson <nickm@torproject.org>
Thu, 19 Apr 2012 03:02:09 +0000 (23:02 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 19 Apr 2012 03:02:09 +0000 (23:02 -0400)
Fix for 5647; bugfix on 0.2.1.5-alpha.

changes/bug5647 [new file with mode: 0644]
src/or/routerparse.c

diff --git a/changes/bug5647 b/changes/bug5647
new file mode 100644 (file)
index 0000000..92f41c8
--- /dev/null
@@ -0,0 +1,4 @@
+  o Major bugfixes:
+    - Avoid logging uninitialized data when unable to decode a hidden
+      service descriptor cookie.  Fixes bug 5647; bugfix on 0.2.1.5-alpha.
+
index 322a2b5713ca290a2515361b50d89c72a0530ab4..8c4f582c076d2c0aa88aae84c67e46311e411246 100644 (file)
@@ -5056,7 +5056,6 @@ rend_parse_client_keys(strmap_t *parsed_clients, const char *ckstr)
   while (!strcmpstart(current_entry, "client-name ")) {
     rend_authorized_client_t *parsed_entry;
     size_t len;
-    char descriptor_cookie_base64[REND_DESC_COOKIE_LEN_BASE64+2+1];
     char descriptor_cookie_tmp[REND_DESC_COOKIE_LEN+2];
     /* Determine end of string. */
     const char *eos = strstr(current_entry, "\nclient-name ");
@@ -5125,7 +5124,7 @@ rend_parse_client_keys(strmap_t *parsed_clients, const char *ckstr)
                        tok->args[0], REND_DESC_COOKIE_LEN_BASE64+2+1)
            != REND_DESC_COOKIE_LEN)) {
       log_warn(LD_REND, "Descriptor cookie contains illegal characters: "
-                        "%s", descriptor_cookie_base64);
+               "%s", escaped(tok->args[0]));
       goto err;
     }
     memcpy(parsed_entry->descriptor_cookie, descriptor_cookie_tmp,