]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
convertAnchPrefixToBounds: check size of delay_adj
authorJustin Viiret <justin.viiret@intel.com>
Mon, 14 Dec 2015 23:05:22 +0000 (10:05 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 1 Mar 2016 00:16:29 +0000 (11:16 +1100)
Avoid subtracting delay_adj from a smaller max bound.

src/rose/rose_build_convert.cpp

index 2ce211bf5f748b5fe5ee6760128d441ffe7ef1c5..f5e99c2327fc24d1a0184b8c1b1dd3e4dae3cc32 100644 (file)
@@ -1098,6 +1098,11 @@ void convertAnchPrefixToBounds(RoseBuildImpl &tbi) {
         DEBUG_PRINTF("castle has repeat %s\n", pr.bounds.str().c_str());
         DEBUG_PRINTF("delay adj %u\n", (u32)delay_adj);
 
+        if (delay_adj >= pr.bounds.max) {
+            DEBUG_PRINTF("delay adj too large\n");
+            continue;
+        }
+
         DepthMinMax bounds(pr.bounds); // copy
         if (delay_adj > bounds.min) {
             bounds.min = 0;