|
|
|
|
|
|
|
|
|
|
xen-api
[Xen-API] [PATCH] CA-40329: Fix the bound checks in the Ipq.find* functi
# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
CA-40329: Fix the bound checks in the Ipq.find* functions.
Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>
diff -r 256e76148ba4 ocaml/xapi/ipq.ml
--- a/ocaml/xapi/ipq.ml Mon Apr 12 20:32:36 2010 +0100
+++ b/ocaml/xapi/ipq.ml Wed Apr 14 14:34:43 2010 +0100
@@ -87,17 +87,15 @@
let find h ev =
let rec iter n =
- match n with
- -1 -> -1
- | m -> if ev = h.data.(n).ev then n else iter (n-1)
+ if n < 0 then -1
+ else if ev = h.data.(n).ev then n else iter (n-1)
in
iter (h.size-1)
let find_p h f =
let rec iter n =
- match n with
- -1 -> -1
- | m -> if f h.data.(n).ev then n else iter (n-1)
+ if n < 0 then -1
+ else if f h.data.(n).ev then n else iter (n-1)
in
iter (h.size-1)
ipq-bounds
Description: Text document
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-API] [PATCH] CA-40329: Fix the bound checks in the Ipq.find* functions.,
Rob Hoes <=
|
|
|
|
|