[or-cvs] r14008: backport: Logging functions now check that the passed severi (in tor/branches/tor-0_2_0-patches: . src/common)

weasel at seul.org weasel at seul.org
Thu Mar 13 16:56:31 UTC 2008


Author: weasel
Date: 2008-03-13 12:56:31 -0400 (Thu, 13 Mar 2008)
New Revision: 14008

Modified:
   tor/branches/tor-0_2_0-patches/ChangeLog
   tor/branches/tor-0_2_0-patches/src/common/log.c
Log:
backport: Logging functions now check that the passed severity is sane.


Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog	2008-03-13 16:56:20 UTC (rev 14007)
+++ tor/branches/tor-0_2_0-patches/ChangeLog	2008-03-13 16:56:31 UTC (rev 14008)
@@ -23,6 +23,7 @@
       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

Modified: tor/branches/tor-0_2_0-patches/src/common/log.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/common/log.c	2008-03-13 16:56:20 UTC (rev 14007)
+++ tor/branches/tor-0_2_0-patches/src/common/log.c	2008-03-13 16:56:31 UTC (rev 14008)
@@ -255,6 +255,9 @@
   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) {



More information about the tor-commits mailing list