]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix formatting in tor_assertf() message in struct_check_magic().
authorNick Mathewson <nickm@torproject.org>
Mon, 16 Dec 2019 20:31:23 +0000 (15:31 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 16 Dec 2019 20:31:23 +0000 (15:31 -0500)
Closes 32771; bugfix on 0.4.2.1-alpha.

changes/bug32771 [new file with mode: 0644]
src/lib/confmgt/structvar.c

diff --git a/changes/bug32771 b/changes/bug32771
new file mode 100644 (file)
index 0000000..606bcf4
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (logging, crash):
+    - Avoid a possible crash when trying to log a (fatal) assertion failure
+      about mismatched magic numbers in configuration objects. Fixes bug 32771;
+      bugfix on 0.4.2.1-alpha.
index de678d18c812ea5621d21322648343d2c4ff332b..7a3b8c7df2232aaa4405266ec323776bf4185aa6 100644 (file)
@@ -53,8 +53,8 @@ struct_check_magic(const void *object, const struct_magic_decl_t *decl)
   const uint32_t *ptr = STRUCT_VAR_P(object, decl->magic_offset);
   tor_assertf(*ptr == decl->magic_val,
               "Bad magic number on purported %s object. "
-              "Expected %"PRIu32"x but got "PRIu32"x.",
-              decl->magic_val, *ptr);
+              "Expected %"PRIu32"x but got %"PRIu32"x.",
+              decl->typename, decl->magic_val, *ptr);
 }
 
 /**