diff options
author | Frediano Ziglio <frediano.ziglio@citrix.com> | 2012-08-02 09:32:36 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-10-10 11:00:03 +0100 |
commit | e45f3540ae7a6298f27d77d1273375a3d765ca38 (patch) | |
tree | c6eec374418c2c0485f1a5f7befd96cc91701ff4 | |
parent | 38398b2bb77fcfbc8109bc837cfaa8fed7a836f1 (diff) | |
download | syslinux-e45f3540ae7a6298f27d77d1273375a3d765ca38.tar.gz |
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@citrix.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r-- | 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 716670c6..7988faaf 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); |