Re: ntdll: Fix RtlIntegerToUnicodeString so it won't overflow

2008-05-08 Thread Alexandre Julliard
"Maarten Lankhorst" <[EMAIL PROTECTED]> writes: > It copies str->Length + sizeof(WCHAR) to the destination buffer > according to james' testcases. So it definitely looks like a bug to me > if it would copy data beyond MaximumLength, since only up to > MaximumLength is guaranteed to be allocated. O

Re: ntdll: Fix RtlIntegerToUnicodeString so it won't overflow

2008-05-08 Thread James Hawkins
On Thu, May 8, 2008 at 1:41 PM, Dan Kegel <[EMAIL PROTECTED]> wrote: > James wrote: >> > It copies str->Length + sizeof(WCHAR) to the destination buffer >> > according to james' testcases. >> >> No, the length is indeterminate. > > Oh, is that the test that checks whether not double-null terminatin

re: ntdll: Fix RtlIntegerToUnicodeString so it won't overflow

2008-05-08 Thread Dan Kegel
James wrote: > > It copies str->Length + sizeof(WCHAR) to the destination buffer > > according to james' testcases. > > No, the length is indeterminate. Oh, is that the test that checks whether not double-null terminating works? I think that test needs rewriting to be determinate... e.g. by putti

Re: ntdll: Fix RtlIntegerToUnicodeString so it won't overflow

2008-05-08 Thread James Hawkins
On Thu, May 8, 2008 at 1:00 PM, Maarten Lankhorst <[EMAIL PROTECTED]> wrote: > Hello Alexandre, > > 2008/5/8 Alexandre Julliard <[EMAIL PROTECTED]>: >> "Maarten Lankhorst" <[EMAIL PROTECTED]> writes: >> >> > @@ -1970,7 +1970,7 @@ NTSTATUS WINAPI RtlIntegerToUnicodeString( >> > } while (value

Re: ntdll: Fix RtlIntegerToUnicodeString so it won't overflow

2008-05-08 Thread Maarten Lankhorst
Hello Alexandre, 2008/5/8 Alexandre Julliard <[EMAIL PROTECTED]>: > "Maarten Lankhorst" <[EMAIL PROTECTED]> writes: > > > @@ -1970,7 +1970,7 @@ NTSTATUS WINAPI RtlIntegerToUnicodeString( > > } while (value != 0L); > > > > str->Length = (&buffer[32] - pos) * sizeof(WCHAR); > > -i

Re: ntdll: Fix RtlIntegerToUnicodeString so it won't overflow

2008-05-08 Thread Alexandre Julliard
"Maarten Lankhorst" <[EMAIL PROTECTED]> writes: > @@ -1970,7 +1970,7 @@ NTSTATUS WINAPI RtlIntegerToUnicodeString( > } while (value != 0L); > > str->Length = (&buffer[32] - pos) * sizeof(WCHAR); > -if (str->Length >= str->MaximumLength) { > +if (str->Length + sizeof(WCHAR) >= s