diff --git a/ChangeLog b/ChangeLog index c629b874a..07580f863 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-02 Bean + + * fs/reiserfs.c (grub_reiserfs_read_symlink): Add 0 at the end of + symlink_buffer. + 2008-03-01 Yoshinori K. Okuji * DISTLIST: Added docs/fdl.texi, docs/grub.texi, docs/mdate-sh and diff --git a/fs/reiserfs.c b/fs/reiserfs.c index a4c60ca8b..b536b21fd 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -659,7 +659,7 @@ grub_reiserfs_read_symlink (grub_fshelp_node_t node) >> GRUB_DISK_SECTOR_BITS); offset = grub_le_to_cpu16 (found.header.item_location); - symlink_buffer = grub_malloc (len); + symlink_buffer = grub_malloc (len + 1); if (! symlink_buffer) goto fail; @@ -667,6 +667,7 @@ grub_reiserfs_read_symlink (grub_fshelp_node_t node) if (grub_errno) goto fail; + symlink_buffer[len] = 0; return symlink_buffer; fail: