From 09298c703e34133d995d4dede0741c85dba12e05 Mon Sep 17 00:00:00 2001
From: tianying <tianying>
Date: Sun, 9 May 2004 09:12:03 +0000
Subject: [PATCH] a small fix to the reference beyond the buffer

---
 lustre/lvfs/llog.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lustre/lvfs/llog.c b/lustre/lvfs/llog.c
index 12da23ba04..0b647a76ae 100644
--- a/lustre/lvfs/llog.c
+++ b/lustre/lvfs/llog.c
@@ -345,6 +345,10 @@ int llog_reverse_process(struct llog_handle *loghandle, llog_cb_t cb,
                         --index;
                         if (index < first_index)
                                 GOTO(out, rc = 0);
+
+                        if ((void *)rec == buf)
+                                break;
+
                         tail = (void *)rec - sizeof(struct llog_rec_tail);
                         rec = ((void *)rec - le32_to_cpu(tail->lrt_len));
                 }
-- 
GitLab