server: Fixed length check in dump_inline_unicode_string.
diff --git a/server/trace.c b/server/trace.c
index 9b4f7bd..4b567f9 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -299,12 +299,12 @@
/* dump a unicode string contained in a buffer; helper for dump_varargs_startup_info */
static void dump_inline_unicode_string( const UNICODE_STRING *str, const void *data, size_t size )
{
- size_t length = str->Length / sizeof(WCHAR);
+ size_t length = str->Length;
size_t offset = (size_t)str->Buffer;
if (offset >= size) return;
if (offset + length > size) length = size - offset;
- dump_strW( (const WCHAR *)data + offset/sizeof(WCHAR), length, stderr, "\"\"" );
+ dump_strW( (const WCHAR *)data + offset/sizeof(WCHAR), length/sizeof(WCHAR), stderr, "\"\"" );
}
static void dump_varargs_startup_info( size_t size )