On Tue, 21 Oct 2008, Vincent Povirk wrote:
> Yep.
>
> It's still broken though; the string I allocated is too small (strlen
> excludes the null terminator), and that will be a problem if cmdline
> ends in a backslash.
Also it would be nice to avoid the HEAP_ZERO_MEMORY if we are going to
overwr
Yep.
It's still broken though; the string I allocated is too small (strlen
excludes the null terminator), and that will be a problem if cmdline
ends in a backslash.
Vincent Povirk
On Tue, Oct 21, 2008 at 8:41 PM, Juan Lang <[EMAIL PROTECTED]> wrote:
> Oops, sorry Vincent, James caught me:
>
>>
Oops, sorry Vincent, James caught me:
> +result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
> sizeof(WCHAR)*strlenW(cmdline));
The HEAP_ZERO_MEMORY is the something obvious I was missing.
/me slinks back to his corner.
--Juan
> I suppose it is possible for the string to not be null-terminated if
> the command line ends in a backslash. I'll fix that and resend.
It's more probable than that, unless I'm missing something. You
allocate result:
+result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(WCHAR)*strle
I suppose it is possible for the string to not be null-terminated if
the command line ends in a backslash. I'll fix that and resend.
Vincent Povirk
On Tue, Oct 21, 2008 at 8:14 PM, Juan Lang <[EMAIL PROTECTED]> wrote:
> Hi Vincent,
>
> +while (*src)
> +{
> +*dest = *src;
> +
Hi Vincent,
+while (*src)
+{
+*dest = *src;
+if (*src == '\\')
+{
+DWORD attrs = GetFileAttributesW(result);
It sure looks like you're calling GetFileAttributesW with a
non-NULL-terminated string. I doubt this will work as you intend.
--Juan