[sheepdog] [PATCH] recovery: fix wrong index in oid_in_recovery()

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Aug 28 06:25:28 CEST 2012


At Tue, 28 Aug 2012 11:31:19 +0800,
Liu Yuan wrote:
> 
> From: Liu Yuan <tailai.ly at taobao.com>
> 
> rw->done is index of the original next object to be recovered and also the
> number of objects already recovered. So rw->done - 1 identify an already
> recovered object. A another caller case is that, if rw->done == 0, we'll end
> up with a -1 valule, which might cause seg fault in the array.
> 
> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
> ---
>  sheep/recovery.c |    8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Applied, thanks!

Kazutaka



More information about the sheepdog mailing list