[sheepdog-users] [PATCH stable-0.8 10/22] recovery: fix buffer overflow of rinfo->oids

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Mon Feb 24 08:06:58 CET 2014


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 sheep/recovery.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sheep/recovery.c b/sheep/recovery.c
index c15297c..50b6c58 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -613,8 +613,8 @@ main_fn bool oid_in_recovery(uint64_t oid)
 		 *
 		 * FIXME: do we need more efficient yet complex data structure?
 		 */
-		if (xlfind(&oid, rinfo->oids + rinfo->done + 1, rinfo->count,
-			   oid_cmp))
+		if (xlfind(&oid, rinfo->oids + rinfo->done + 1,
+			   rinfo->count - (rinfo->done + 1), oid_cmp))
 			break;
 
 		/*
-- 
1.7.10.4




More information about the sheepdog-users mailing list