Bug in the kernel
Posted: Thu Mar 27, 2008 11:54 pm
Hi,
in string.cpp of the 'lib' part of the kernel, you have the following function is defined
Surely you need either a length parameter or a test for a null terminator otherwise you will write your way to the end of memory.
My suggesting would be:
Andrew
in string.cpp of the 'lib' part of the kernel, you have the following function is defined
Code: Select all
//! copies string s2 to s1
char *strcpy(char *s1, const char *s2)
{
char *s1_p = s1;
while (*s1++ = *s2++);
return s1_p;
}
My suggesting would be:
Code: Select all
//! copies string s2 to s1
char *strcpy(char *s1, const char *s2)
{
char *s1_p = s1;
while (*s1)
*s1++ = *s2++;
return s1_p;
}