* include/grub/misc.h (grub_strncat): Fix the order of conditionals to
avoid accessing beyond the array.
This commit is contained in:
parent
19e81ba7a0
commit
57b0125004
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2011-11-09 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* include/grub/misc.h (grub_strncat): Fix the order of conditionals to
|
||||
avoid accessing beyond the array.
|
||||
|
||||
2011-11-09 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* configure.ac: Add missing -mXX to TARGET_CPPFLAGS.
|
||||
|
|
|
@ -87,7 +87,7 @@ grub_strncat (char *dest, const char *src, int c)
|
|||
while (*p)
|
||||
p++;
|
||||
|
||||
while ((*p = *src) != '\0' && c--)
|
||||
while (c-- && (*p = *src) != '\0')
|
||||
{
|
||||
p++;
|
||||
src++;
|
||||
|
|
Loading…
Reference in a new issue