[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-API] [PATCH] CA-40329: Fix the bound checks in the Ipq.find* functions.
# 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) Attachment:
ipq-bounds _______________________________________________ xen-api mailing list xen-api@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/mailman/listinfo/xen-api
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |