summaryrefslogtreecommitdiff
path: root/core/fs/fs.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-02-24 18:24:14 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-02-24 18:24:14 -0800
commit6b3041d5e663ebeb162782d44b1d92fe2bd35fdf (patch)
tree53991be6f72171878bbbe2491fbe785dd065f64b /core/fs/fs.c
parent8a4b35805fdc6651d288a3e1c2d98aa504cb9c05 (diff)
downloadsyslinux-6b3041d5e663ebeb162782d44b1d92fe2bd35fdf.tar.gz
core: fix double free of pathbuf, constify iget filename, fix iso9660
Fix double free of pathbuf in searchdir(). Constify the pathname passed to ->iget(). Major cleanups of the iso9660 filesystem; it would use insufficiently dimensioned stack variables and do compares in a rather inefficient manner. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core/fs/fs.c')
-rw-r--r--core/fs/fs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fs/fs.c b/core/fs/fs.c
index e0f469ba..c24feede 100644
--- a/core/fs/fs.c
+++ b/core/fs/fs.c
@@ -232,7 +232,7 @@ int searchdir(const char *name)
if (inode->mode == I_SYMLINK) {
char *linkbuf, *q;
int name_len = echar ? strlen(p) : 0;
- int total_len = inode->size + name_len + (echar ? 2 : 1);
+ int total_len = inode->size + name_len + 2;
int link_len;
if (!this_fs->fs_ops->readlink ||
@@ -284,6 +284,7 @@ int searchdir(const char *name)
} while (0);
free(pathbuf);
+ pathbuf = NULL;
put_inode(parent);
parent = NULL;