]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix assert unsigned-vs-0 comparison
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 4 Jun 2013 03:55:55 +0000 (21:55 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 4 Jun 2013 03:55:55 +0000 (21:55 -0600)
Nodes::size_type is unsigned and cannot be <0.

 Detected by Coverity Scan. Issue 1026516.

src/acl/Tree.cc

index 3a416aea2700a6741a1cb157ff2cbf65ff0035dc..4b79abaa94d86951ee4d2259d4314dbbd4973f2c 100644 (file)
@@ -22,7 +22,7 @@ Acl::Tree::lastAction() const
 allow_t
 Acl::Tree::actionAt(const Nodes::size_type pos) const
 {
-    assert(0 <= pos && pos < nodes.size());
+    assert(pos < nodes.size());
     if (actions.size()) {
         assert(actions.size() == nodes.size());
         return actions[pos];