summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2008-03-13 16:56:31 +0000
committerPeter Palfrader <peter@palfrader.org>2008-03-13 16:56:31 +0000
commit46b104b9e728131645e59ba77670599ef8c39a9e (patch)
tree16169ca2dd6541f5e62e42b1977492a70c6e8803
parentfc33b331dfd29488ad2c3f18692e4be8be81324b (diff)
downloadtor-46b104b9e728131645e59ba77670599ef8c39a9e.tar.gz
tor-46b104b9e728131645e59ba77670599ef8c39a9e.zip
backport: Logging functions now check that the passed severity is sane.
svn:r14008
-rw-r--r--ChangeLog1
-rw-r--r--src/common/log.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b5721e9688..6ab6c6626d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,7 @@ Changes in version 0.2.0.22-rc - 2008-03-??
614. Bugfix on 0.1.2.x.
- Make --enable-openbsd-malloc work correctly on Linux with alpha CPUs.
Fixes bug 625. Bugfix on 0.2.0.x.
+ - Logging functions now check that the passed severity is sane.
Changes in version 0.2.0.21-rc - 2008-03-02
diff --git a/src/common/log.c b/src/common/log.c
index 6dfed6ca77..585cea4a00 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -255,6 +255,9 @@ logv(int severity, uint32_t domain, const char *funcname, const char *format,
char *end_of_prefix=NULL;
assert(format);
+ /* check that severity is sane. Overrunning the masks array leads to
+ * interesting and hard to diagnose effects */
+ assert(severity >= LOG_ERR && severity <= LOG_DEBUG);
LOCK_LOGS();
lf = logfiles;
while (lf) {