mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-23 07:39:22 +00:00
* grub-core/fs/affs.c (grub_affs_read_symlink): Fix handling of long
symlinks. Replace leading colon with a slash.
This commit is contained in:
1 parent
57f4a70b0d
commit
33eca6e005
2 files changed
+10
-2
No files matched your search
@@ -1,3 +1,8 @@
|
|||||||
|
2012-05-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/fs/affs.c (grub_affs_read_symlink): Fix handling of long
|
||||||
|
symlinks. Replace leading colon with a slash.
|
||||||
|
|
||||||
2012-05-12 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-05-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/fs/jfs.c (grub_jfs_find_file): Handle multiple slashes in
|
* grub-core/fs/jfs.c (grub_jfs_find_file): Handle multiple slashes in
|
||||||
|
|||||||
+5
-2
@@ -280,9 +280,9 @@ grub_affs_read_symlink (grub_fshelp_node_t node)
|
|||||||
struct grub_affs_data *data = node->data;
|
struct grub_affs_data *data = node->data;
|
||||||
grub_uint8_t *latin1, *utf8;
|
grub_uint8_t *latin1, *utf8;
|
||||||
const grub_size_t symlink_size = ((GRUB_DISK_SECTOR_SIZE
|
const grub_size_t symlink_size = ((GRUB_DISK_SECTOR_SIZE
|
||||||
<< data->log_blocksize) - 225);
|
<< data->log_blocksize) - GRUB_AFFS_SYMLINK_OFFSET);
|
||||||
|
|
||||||
latin1 = grub_malloc (symlink_size);
|
latin1 = grub_malloc (symlink_size + 1);
|
||||||
if (!latin1)
|
if (!latin1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -295,6 +295,7 @@ grub_affs_read_symlink (grub_fshelp_node_t node)
|
|||||||
grub_free (latin1);
|
grub_free (latin1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
latin1[symlink_size] = 0;
|
||||||
utf8 = grub_malloc (symlink_size * GRUB_MAX_UTF8_PER_LATIN1 + 1);
|
utf8 = grub_malloc (symlink_size * GRUB_MAX_UTF8_PER_LATIN1 + 1);
|
||||||
if (!utf8)
|
if (!utf8)
|
||||||
{
|
{
|
||||||
@@ -304,6 +305,8 @@ grub_affs_read_symlink (grub_fshelp_node_t node)
|
|||||||
*grub_latin1_to_utf8 (utf8, latin1, symlink_size) = '\0';
|
*grub_latin1_to_utf8 (utf8, latin1, symlink_size) = '\0';
|
||||||
grub_dprintf ("affs", "Symlink: `%s'\n", utf8);
|
grub_dprintf ("affs", "Symlink: `%s'\n", utf8);
|
||||||
grub_free (latin1);
|
grub_free (latin1);
|
||||||
|
if (utf8[0] == ':')
|
||||||
|
utf8[0] = '/';
|
||||||
return (char *) utf8;
|
return (char *) utf8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user