[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Fix formatting in tor_assertf() message in struct_check_magic().
commit b4977d1aa9366cdb1475664bcf1486fbfdf5a166
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Mon Dec 16 15:31:23 2019 -0500
Fix formatting in tor_assertf() message in struct_check_magic().
Closes 32771; bugfix on 0.4.2.1-alpha.
---
changes/bug32771 | 4 ++++
src/lib/confmgt/structvar.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/changes/bug32771 b/changes/bug32771
new file mode 100644
index 000000000..606bcf4be
--- /dev/null
+++ b/changes/bug32771
@@ -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.
diff --git a/src/lib/confmgt/structvar.c b/src/lib/confmgt/structvar.c
index de678d18c..7a3b8c7df 100644
--- a/src/lib/confmgt/structvar.c
+++ b/src/lib/confmgt/structvar.c
@@ -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);
}
/**
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits