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 /src/common/log.c | |
parent | fc33b331dfd29488ad2c3f18692e4be8be81324b (diff) | |
download | tor-46b104b9e728131645e59ba77670599ef8c39a9e.tar.gz tor-46b104b9e728131645e59ba77670599ef8c39a9e.zip |
backport: Logging functions now check that the passed severity is sane.
svn:r14008
Diffstat (limited to 'src/common/log.c')
-rw-r--r-- | src/common/log.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) { |