[PATCH 1/5] start.exe: unquote the title

Alexandre Julliard julliard at winehq.org
Mon Aug 5 04:08:16 CDT 2019


Damjan Jovanovic <damjan.jov at gmail.com> writes:

> On Sun, Aug 4, 2019 at 6:12 AM Zebediah Figura <z.figura12 at gmail.com> wrote:
>
>  Hello Damjan,
>
> Hi
>  
>  
>  On 8/3/19 10:24 PM, Damjan Jovanovic wrote:
>  >  int wmain (int argc, WCHAR *argv[])
>  >  {
>  >       SHELLEXECUTEINFOW sei;
>  > @@ -223,7 +242,13 @@ int wmain (int argc, WCHAR *argv[])
>  >       for (i=1; i<argc; i++) {
>  >                  /* parse first quoted argument as console title */
>  >                  if (!title && argv[i][0] == '"') {
>  > -                     title = argv[i];
>  > +                     /* it will remove at least 1 quote */
>  > +                     int maxChars = lstrlenW(argv[1]);
>  > +                     title = HeapAlloc(GetProcessHeap(), 0, maxChars*sizeof(WCHAR));
>  > +                     if (title)
>  > +                             parse_title(argv[i], title, maxChars);
>  > +                     else
>  > +                             fatal_string(STRING_NOMEMFORTITLE);
>  >                       continue;
>  >               }
>  >               if (argv[i][0] != '/')
>
>  Is this really salient enough to warrant error handling? I wouldn't 
>  particularly imagine we're likely to run out of memory here.
>
> Is it now Wine policy to ignore memory allocation errors?
> Since when?

In a short-lived executable like start.exe, handling allocation errors
is usually a waste of time. If that offends you and you really want to
check, a simple abort will do. There's no need to add a translatable
resource string for this.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list