[syslinux:master] ext2: add additional check to ext2 loader

syslinux-bot for Frediano Ziglio frediano.ziglio at citrix.com
Mon Oct 22 12:51:16 PDT 2012


Commit-ID:  e45f3540ae7a6298f27d77d1273375a3d765ca38
Gitweb:     http://www.syslinux.org/commit/e45f3540ae7a6298f27d77d1273375a3d765ca38
Author:     Frediano Ziglio <frediano.ziglio at citrix.com>
AuthorDate: Thu, 2 Aug 2012 09:32:36 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Wed, 10 Oct 2012 11:00:03 +0100

ext2: add additional check to ext2 loader

Check if a pointer is NULL due to specifying an invalid inode group
number.

Signed-off-by: Frediano Ziglio <frediano.ziglio at citrix.com>
Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 core/fs/ext2/ext2.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/core/fs/ext2/ext2.c b/core/fs/ext2/ext2.c
index 716670c..7988faa 100644
--- a/core/fs/ext2/ext2.c
+++ b/core/fs/ext2/ext2.c
@@ -164,6 +164,9 @@ static struct inode *ext2_iget_by_inr(struct fs_info *fs, uint32_t inr)
     struct inode *inode;
 
     e_inode = ext2_get_inode(fs, inr);
+    if (!e_inode)
+	return NULL;
+
     if (!(inode = alloc_inode(fs, inr, sizeof(struct ext2_pvt_inode))))
 	return NULL;
     fill_inode(inode, e_inode);


More information about the Syslinux-commits mailing list