diff --git a/ChangeLog b/ChangeLog index 68be8cfe6..b6d1f02cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-12-27 Vladimir Serbinenko + + * normal/menu_text.c (grub_print_message_indented): Prevent + past-the-end-of-array dereference. + 2009-12-27 Vladimir Serbinenko * video/readers/jpeg.c (GRUB_MOD_FINI (grub_cmd_jpegtest)): Rename to .. diff --git a/normal/menu_text.c b/normal/menu_text.c index 4f2dfb78e..bac15f32b 100644 --- a/normal/menu_text.c +++ b/normal/menu_text.c @@ -137,8 +137,8 @@ grub_print_message_indented (const char *msg, int margin_left, int margin_right) next_new_line = (grub_uint32_t *) last_position; while (grub_getstringwidth (current_position, next_new_line) > line_len - || (*next_new_line != ' ' && next_new_line > current_position && - next_new_line != last_position)) + || (next_new_line != last_position && *next_new_line != ' ' + && next_new_line > current_position)) { next_new_line--; }