]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
bug_occurred: a place where we assumed that "buf" was still a buffer
authorNick Mathewson <nickm@torproject.org>
Sun, 31 Mar 2019 01:07:15 +0000 (21:07 -0400)
committerNick Mathewson <nickm@torproject.org>
Sun, 31 Mar 2019 01:07:15 +0000 (21:07 -0400)
In 9c132a5f9e87a2cd0f we replaced "buf" with a pointer and replaced
one instance of snprintf with asprintf -- but there was still one
snprintf left over, being crashy.

Fixes bug 29967; bug not in any released Tor. This is CID 1444262.

src/lib/log/util_bug.c

index b9dc296fc683972d59322e5c07890a0b1dcd27f1..65ab7bc9c69a8dcbfea9057ddfda36ab254e0569 100644 (file)
@@ -117,7 +117,7 @@ tor_bug_occurred_(const char *fname, unsigned int line,
     }
     log_warn(LD_BUG, "%s:%u: %s: This line should not have been reached.%s",
              fname, line, func, once_str);
-    tor_snprintf(buf, sizeof(buf),
+    tor_asprintf(&buf,
                  "Line unexpectedly reached at %s at %s:%u",
                  func, fname, line);
   } else {