Check user_strlcpy() return value (CID 4053).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40096 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2246,17 +2246,18 @@ _user_kernel_debugger(const char *userMessage)
|
|||||||
void
|
void
|
||||||
_user_debug_output(const char* userString)
|
_user_debug_output(const char* userString)
|
||||||
{
|
{
|
||||||
char string[512];
|
|
||||||
int32 length;
|
|
||||||
|
|
||||||
if (!sSerialDebugEnabled && !sSyslogOutputEnabled)
|
if (!sSerialDebugEnabled && !sSyslogOutputEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!IS_USER_ADDRESS(userString))
|
if (!IS_USER_ADDRESS(userString))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
char string[512];
|
||||||
|
int32 length;
|
||||||
do {
|
do {
|
||||||
length = user_strlcpy(string, userString, sizeof(string));
|
length = user_strlcpy(string, userString, sizeof(string));
|
||||||
|
if (length <= 0)
|
||||||
|
break;
|
||||||
debug_puts(string, length);
|
debug_puts(string, length);
|
||||||
userString += sizeof(string) - 1;
|
userString += sizeof(string) - 1;
|
||||||
} while (length >= (ssize_t)sizeof(string));
|
} while (length >= (ssize_t)sizeof(string));
|
||||||
|
|||||||
Reference in New Issue
Block a user