2008-07-29 Bean <bean123ch@gmail.com>
* normal/main.c (get_line): Fix buffer overflow bug.
This commit is contained in:
parent
41694fd019
commit
e93e4679ce
2 changed files with 7 additions and 3 deletions
|
@ -97,9 +97,6 @@ get_line (grub_file_t file)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (c == '\n')
|
||||
break;
|
||||
|
||||
if (pos >= max_len)
|
||||
{
|
||||
char *old_cmdline = cmdline;
|
||||
|
@ -112,6 +109,9 @@ get_line (grub_file_t file)
|
|||
}
|
||||
}
|
||||
|
||||
if (c == '\n')
|
||||
break;
|
||||
|
||||
cmdline[pos++] = c;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue