From 97ba3fb358d7146426acea54d1aade63b61792cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 30 Oct 2008 18:29:49 +0000 Subject: [PATCH] * Instead of faulting when trying to print an invalid string pointer, print_demangled_call() will now use user_strlcpy() to copy the string first (if that fails, it will printf '???' to show this). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28386 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_debug.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_debug.cpp b/src/system/kernel/arch/x86/arch_debug.cpp index d799e2ec15..39447c2ffc 100644 --- a/src/system/kernel/arch/x86/arch_debug.cpp +++ b/src/system/kernel/arch/x86/arch_debug.cpp @@ -218,8 +218,12 @@ print_demangled_call(const char* image, const char* symbol, addr_t args, break; } - if (type == B_STRING_TYPE) - kprintf(" \"%s\"", (char*)value); + if (type == B_STRING_TYPE) { + if (user_strlcpy(buffer, (char*)value, sizeof(buffer)) < B_OK) + kprintf(" '???'"); + else + kprintf(" \"%s\"", buffer); + } if (addDebugVariables) set_debug_argument_variable(i, value);