2013-06-07 18:03:56 +00:00
|
|
|
From 64ab320166410339edd8ae49b19780f1a793f450 Mon Sep 17 00:00:00 2001
|
2013-05-02 20:54:52 +00:00
|
|
|
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
|
|
|
|
Date: Mon, 10 Dec 2012 09:22:40 +0100
|
2013-06-12 19:24:37 +00:00
|
|
|
Subject: [PATCH 059/482] * grub-core/fs/ufs.c (grub_ufs_dir): Stop if
|
2013-05-02 20:54:52 +00:00
|
|
|
direntlen is 0 to avoid infinite loop on corrupted FS.
|
|
|
|
|
|
|
|
---
|
|
|
|
ChangeLog | 5 +++++
|
|
|
|
grub-core/fs/ufs.c | 3 +++
|
|
|
|
2 files changed, 8 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/ChangeLog b/ChangeLog
|
|
|
|
index 9c6dde5..0b1596a 100644
|
|
|
|
--- a/ChangeLog
|
|
|
|
+++ b/ChangeLog
|
|
|
|
@@ -1,3 +1,8 @@
|
|
|
|
+2012-12-10 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
|
+
|
|
|
|
+ * grub-core/fs/ufs.c (grub_ufs_dir): Stop if direntlen is 0 to avoid
|
|
|
|
+ infinite loop on corrupted FS.
|
|
|
|
+
|
|
|
|
2012-12-08 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
|
|
|
|
|
Fix big-endian mtime.
|
|
|
|
diff --git a/grub-core/fs/ufs.c b/grub-core/fs/ufs.c
|
|
|
|
index c862336..74a4a40 100644
|
|
|
|
--- a/grub-core/fs/ufs.c
|
|
|
|
+++ b/grub-core/fs/ufs.c
|
|
|
|
@@ -664,6 +664,9 @@ grub_ufs_dir (grub_device_t device, const char *path,
|
|
|
|
(char *) &dirent) < 0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
+ if (dirent.direntlen == 0)
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
#ifdef MODE_UFS2
|
|
|
|
namelen = dirent.namelen_bsd;
|
|
|
|
#else
|
|
|
|
--
|
2013-06-07 18:03:56 +00:00
|
|
|
1.8.2.1
|
2013-05-02 20:54:52 +00:00
|
|
|
|