* grub-core/normal/menu_entry.c (insert_string): fix off by one
access to unallocated memory.
This commit is contained in:
parent
b7b78edb1c
commit
958bfd2067
2 changed files with 11 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2013-02-25 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/normal/menu_entry.c (insert_string): fix off by one
|
||||||
|
access to unallocated memory.
|
||||||
|
|
||||||
2013-02-25 Andrey Borzenkov <arvidjaar@gmail.com>
|
2013-02-25 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||||
|
|
||||||
* Makefile.util.def: Add partmap/msdos.c to common library.
|
* Makefile.util.def: Add partmap/msdos.c to common library.
|
||||||
|
|
|
@ -393,11 +393,12 @@ insert_string (struct screen *screen, const char *s, int update)
|
||||||
if (! screen->lines)
|
if (! screen->lines)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Scroll down. */
|
/* Shift down if not appending after the last line. */
|
||||||
grub_memmove (screen->lines + screen->line + 2,
|
if (screen->line < screen->num_lines - 2)
|
||||||
screen->lines + screen->line + 1,
|
grub_memmove (screen->lines + screen->line + 2,
|
||||||
((screen->num_lines - screen->line - 2)
|
screen->lines + screen->line + 1,
|
||||||
* sizeof (struct line)));
|
((screen->num_lines - screen->line - 2)
|
||||||
|
* sizeof (struct line)));
|
||||||
|
|
||||||
if (! init_line (screen, screen->lines + screen->line + 1))
|
if (! init_line (screen, screen->lines + screen->line + 1))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue