[PATCH] Report error for NULL list_head pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Rabin Vincent <rabinv@xxxxxxxx>

If we hit a NULL next pointer on a struct list_head list it means the
list is corrupted.
---
 tools.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools.c b/tools.c
index 8190d7e..577820d 100644
--- a/tools.c
+++ b/tools.c
@@ -3808,6 +3808,12 @@ do_list(struct list_data *ld)
 		}
 
 		if (next == 0) {
+			if (ld->flags & LIST_HEAD_FORMAT) {
+				error(INFO, "\ninvalid list entry: 0\n");
+				if (close_hq_on_return)
+					hq_close();
+				return -1;
+			}
 			if (CRASHDEBUG(1))
 				console("do_list end: next:%lx\n", next);
 			break;
-- 
2.7.0

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility



[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux