]> granicus.if.org Git - libevent/commitdiff
Detect and reject n_priorities less than 1.
authorNick Mathewson <nickm@torproject.org>
Wed, 22 Apr 2009 20:28:30 +0000 (20:28 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 22 Apr 2009 20:28:30 +0000 (20:28 +0000)
svn:r1222

ChangeLog
event.c

index 6fe390903ca1bb44da6931d4f83392ac3d5d9efc..aea64512c9710696d62902bb59200590d9bf26a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@ Changes in 2.0.2-alpha:
  o Make evdns functionality locked, and automatically defer dns callbacks.
  o Fix a possible free(NULL) when freeing an event_base with no signals.
  o Add a flag to disable checking environment varibles when making an event_base
+ o Disallow setting less than 1 priority.
 
 Changes in 2.0.1-alpha:
  o free minheap on event_base_free(); from Christopher Layne
diff --git a/event.c b/event.c
index 2778d7950d6cf6b3d3fb6ad1205b9f9b4b01baae..4792827f27aa0278671998247bab70a5c9060855 100644 (file)
--- a/event.c
+++ b/event.c
@@ -548,7 +548,7 @@ event_base_priority_init(struct event_base *base, int npriorities)
 {
        int i;
 
-       if (base->event_count_active)
+       if (base->event_count_active || npriorities < 1)
                return (-1);
 
        if (npriorities == base->nactivequeues)