diff options
author | Peter Palfrader <peter@palfrader.org> | 2008-03-13 16:56:31 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2008-03-13 16:56:31 +0000 |
commit | 46b104b9e728131645e59ba77670599ef8c39a9e (patch) | |
tree | 16169ca2dd6541f5e62e42b1977492a70c6e8803 | |
parent | fc33b331dfd29488ad2c3f18692e4be8be81324b (diff) | |
download | tor-46b104b9e728131645e59ba77670599ef8c39a9e.tar.gz tor-46b104b9e728131645e59ba77670599ef8c39a9e.zip |
backport: Logging functions now check that the passed severity is sane.
svn:r14008
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/common/log.c | 3 |
2 files changed, 4 insertions, 0 deletions
@@ -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) { |