]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Limited value must never go under zero
authorMaria Matejka <mq@ucw.cz>
Tue, 11 Oct 2022 09:06:58 +0000 (11:06 +0200)
committerMaria Matejka <mq@ucw.cz>
Wed, 12 Oct 2022 08:05:14 +0000 (10:05 +0200)
nest/limit.h

index 5838ad3b8d16a916cac73a85a9fb11e3032dff75..f8d4b212e3ee3e15b84f7ba370ea830b476d15ab 100644 (file)
@@ -32,6 +32,7 @@ static inline int limit_push(struct limit *l, void *data)
 
 static inline void limit_pop(struct limit *l)
 {
+  ASSERT_DIE(l->count > 0);
   --l->count;
 }