diff --git a/ChangeLog b/ChangeLog index b25bcc0a7..f1eb652d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-05-17 Vladimir Serbinenko + + * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Don't strrchr + through UTF-16. + 2012-05-17 Vladimir Serbinenko * grub-core/fs/fat.c (grub_fat_find_dir): Fix error message. diff --git a/grub-core/fs/iso9660.c b/grub-core/fs/iso9660.c index 992de35b6..318d07edb 100644 --- a/grub-core/fs/iso9660.c +++ b/grub-core/fs/iso9660.c @@ -725,30 +725,29 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, type = GRUB_FSHELP_REG; } + /* . and .. */ + if (!filename && dirent.namelen == 1 && (name[0] == ';' || name[0] == 0 || name[0] == 1)) + { + grub_free (node); + continue; + } + /* The filename was not stored in a rock ridge entry. Read it from the iso9660 filesystem. */ - if (!filename) + if (!dir->data->joliet && !filename) { name[dirent.namelen] = '\0'; filename = grub_strrchr (name, ';'); if (filename) *filename = '\0'; - - /* . and .. */ - if (dirent.namelen == 1 && (name[0] == 0 || name[0] == 1)) - { - grub_free (node); - continue; - } - else - filename = name; + filename = name; } - if (dir->data->joliet) + if (dir->data->joliet && !filename) { char *oldname, *semicolon; - oldname = filename; + oldname = name; filename = grub_iso9660_convert_string ((grub_uint8_t *) oldname, dirent.namelen >> 1);